add production stage

This commit is contained in:
Rob Loranger 2019-09-17 10:17:14 -07:00
parent 08403ca845
commit 66d9ecf387
No known key found for this signature in database
GPG key ID: D6F1633A4F0903B8

View file

@ -16,12 +16,21 @@ RUN mkdir -p \
cp -r templates/ pages/ static/ /home/writefreely && \
cp config.ini.example /home/writefreely/config.ini
FROM alpine AS final
FROM alpine AS dev
# TODO user nobody or similar
COPY --from=build /src/cmd/writefreely/writefreely /bin
COPY --from=build /home /home
EXPOSE 8080
WORKDIR /home/writefreely
ENTRYPOINT [ "writefreely" ]
FROM alpine AS prod
RUN apk add ca-certificates openssl
COPY --from=dev . .
EXPOSE 80 443
WORKDIR /home/writefreely
ENTRYPOINT [ "writefreely" ]