1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

fix: update docekr file to include env vars and volume

This commit is contained in:
Ferdinand Mütsch 2020-04-26 15:18:47 +02:00
parent b05105cbeb
commit f264ede147

View File

@ -1,8 +1,10 @@
# Build Stage # Build Stage
FROM golang:1.13 AS build-env FROM golang:1.13 AS build-env
ADD . /src ADD . /src
RUN cd /src && go build -o wakapi RUN cd /src && go build -o wakapi
# Final Stage # Final Stage
# When running the application using `docker run`, you can pass environment variables # When running the application using `docker run`, you can pass environment variables
@ -20,6 +22,15 @@ RUN cd /src && go build -o wakapi
FROM debian FROM debian
WORKDIR /app WORKDIR /app
ENV ENV prod
ENV WAKAPI_DB_TYPE sqlite3
ENV WAKAPI_DB_USER ''
ENV WAKAPI_DB_PASSWORD ''
ENV WAKAPI_DB_HOST ''
ENV WAKAPI_DB_NAME=/data/wakapi.db
ENV WAKAPI_DEFAULT_USER_NAME admin
ENV WAKAPI_DEFAULT_USER_PASSWORD admin
COPY --from=build-env /src/wakapi /app/ COPY --from=build-env /src/wakapi /app/
COPY --from=build-env /src/config.ini /app/ COPY --from=build-env /src/config.ini /app/
COPY --from=build-env /src/.env.example /app/.env COPY --from=build-env /src/.env.example /app/.env
@ -32,4 +43,6 @@ ADD migrations /app/migrations
ADD views /app/views ADD views /app/views
ADD wait-for-it.sh . ADD wait-for-it.sh .
VOLUME /data
ENTRYPOINT ./wait-for-it.sh ENTRYPOINT ./wait-for-it.sh