1
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
services:
|
||||
golang-builder:
|
||||
build:
|
||||
dockerfile_inline: |
|
||||
FROM golang:alpine
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
|
||||
&& apk add --no-cache git ca-certificates tzdata
|
||||
ENV TZ=Asia/Shanghai
|
||||
ENV GO111MODULE=on
|
||||
ENV GOPROXY=https://goproxy.cn,direct
|
||||
ENV CGO_ENABLED=0
|
||||
ENV GOTOOLCHAIN=auto
|
||||
image: video-factory-builder:base
|
||||
|
||||
alpine-runtime:
|
||||
build:
|
||||
dockerfile_inline: |
|
||||
FROM alpine:3.19
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
|
||||
&& apk add --no-cache ca-certificates tzdata ffmpeg
|
||||
ENV TZ=Asia/Shanghai
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
image: video-factory-runtime:base
|
||||
+2
-13
@@ -2,24 +2,13 @@ services:
|
||||
video-factory:
|
||||
build:
|
||||
dockerfile_inline: |
|
||||
FROM golang:alpine AS builder
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
|
||||
&& apk add --no-cache git ca-certificates tzdata
|
||||
ENV TZ=Asia/Shanghai
|
||||
ENV GO111MODULE=on
|
||||
ENV GOPROXY=https://goproxy.cn,direct
|
||||
ENV CGO_ENABLED=0
|
||||
ENV GOTOOLCHAIN=auto
|
||||
FROM video-factory-builder:base AS builder
|
||||
WORKDIR /build
|
||||
COPY . .
|
||||
RUN go mod download && go mod tidy
|
||||
RUN go build -ldflags="-s -w" -o main ./main.go
|
||||
|
||||
FROM alpine:3.19
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
|
||||
&& apk add --no-cache ca-certificates tzdata ffmpeg
|
||||
ENV TZ=Asia/Shanghai
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
FROM video-factory-runtime:base
|
||||
WORKDIR /app
|
||||
COPY --from=builder /build/config.yml .
|
||||
COPY --from=builder /build/prompt.md .
|
||||
|
||||
Reference in New Issue
Block a user