31 lines
1.0 KiB
YAML
31 lines
1.0 KiB
YAML
services:
|
|
video-factory:
|
|
build:
|
|
dockerfile_inline: |
|
|
FROM vf-golang-base:latest AS builder
|
|
WORKDIR /build
|
|
COPY . .
|
|
RUN go mod download && go mod tidy
|
|
RUN go build -ldflags="-s -w" -o main ./main.go
|
|
|
|
FROM vf-alpine-base:latest
|
|
WORKDIR /app
|
|
COPY --from=builder /build/config.yml .
|
|
COPY --from=builder /build/prompt.md .
|
|
COPY --from=builder /build/default_first_frame.png .
|
|
COPY --from=builder /build/main .
|
|
RUN printf '#!/bin/sh\nif [ -d /app/short_drama.db ]; then rm -rf /app/short_drama.db; fi\ntouch /app/short_drama.db 2>/dev/null || true\nexec ./main\n' > /app/entrypoint.sh && chmod +x /app/entrypoint.sh
|
|
EXPOSE 3006
|
|
ENTRYPOINT ["/app/entrypoint.sh"]
|
|
container_name: video-factory
|
|
ports:
|
|
- "3006:3006"
|
|
volumes:
|
|
- /data/video-factory/workspace:/app/workspace
|
|
- /data/video-factory/short_drama.db:/app/short_drama.db
|
|
restart: unless-stopped
|
|
|
|
networks:
|
|
default:
|
|
name: video-factory-network
|