Diffstat (limited to 'Dockerfile')
| -rw-r--r-- | Dockerfile | 27 |
1 files changed, 7 insertions, 20 deletions
@@ -1,32 +1,19 @@ -FROM golang:1.26.4-alpine3.24 AS build-stage - -ARG TARGETOS=linux -ARG TARGETARCH=amd64 -ENV GOOS=${TARGETOS} -ENV GOARCH=${TARGETARCH} - -RUN apk add --no-cache sqlite-dev musl-dev gcc +FROM golang:1.24.5-alpine3.22 AS build-stage WORKDIR /builddir COPY . . -RUN go mod download -RUN CGO_ENABLED=1 go build -o sayana-web . +RUN go build -o sayana-demo . -FROM alpine:3.24 AS runtime-stage +FROM alpine:3.22.1 AS runtime-stage -ENV ENVIRONMENT="" -ENV AUTH_SALT="" ENV B2_KEY_ID="" ENV B2_APPLICATION_KEY="" WORKDIR /app -COPY --from=build-stage /builddir/sayana-web /app/sayana-web -COPY --from=build-stage /builddir/migrations /app/migrations +COPY --from=build-stage /builddir/sayana-demo /app/sayana-demo COPY --from=build-stage /builddir/static /app/static COPY --from=build-stage /builddir/views /app/views -COPY --from=build-stage /builddir/l10n/*.yaml /app/l10n/ -COPY --from=build-stage /builddir/config/config.*.yaml /app/config/ - -RUN apk add --no-cache tzdata sqlite +COPY --from=build-stage /builddir/locale/*.yaml /app/locale/ +COPY --from=build-stage /builddir/config/config.yaml /app/config.yaml -ENTRYPOINT /app/sayana-web -c /app/config/config.${ENVIRONMENT}.yaml +ENTRYPOINT [ "/app/sayana-demo", "-c", "/app/config.yaml" ] |