2019-10-08 10:08:52 +03:00
|
|
|
# Build Stage
|
2020-04-26 16:18:47 +03:00
|
|
|
|
2021-01-07 12:04:36 +03:00
|
|
|
FROM golang:1.15 AS build-env
|
2020-10-25 09:21:41 +03:00
|
|
|
WORKDIR /src
|
|
|
|
ADD ./go.mod .
|
|
|
|
RUN go mod download
|
2019-10-08 01:41:00 +03:00
|
|
|
|
2020-10-25 09:21:41 +03:00
|
|
|
ADD . .
|
|
|
|
RUN go build -o wakapi
|
2020-04-26 16:18:47 +03:00
|
|
|
|
2021-01-07 12:04:36 +03:00
|
|
|
# Run Stage
|
2020-04-26 16:07:00 +03:00
|
|
|
|
2019-10-08 10:08:52 +03:00
|
|
|
# When running the application using `docker run`, you can pass environment variables
|
2020-10-04 12:52:52 +03:00
|
|
|
# to override config values using `-e` syntax.
|
2021-01-07 12:04:36 +03:00
|
|
|
# Available options can be found in [README.md#-configuration](README.md#-configuration)
|
2020-04-26 16:07:00 +03:00
|
|
|
|
|
|
|
FROM debian
|
2019-10-08 01:41:00 +03:00
|
|
|
WORKDIR /app
|
2020-04-26 16:07:00 +03:00
|
|
|
|
2020-10-04 12:52:52 +03:00
|
|
|
ENV ENVIRONMENT prod
|
2020-04-26 16:18:47 +03:00
|
|
|
ENV WAKAPI_DB_TYPE sqlite3
|
|
|
|
ENV WAKAPI_DB_USER ''
|
|
|
|
ENV WAKAPI_DB_PASSWORD ''
|
|
|
|
ENV WAKAPI_DB_HOST ''
|
|
|
|
ENV WAKAPI_DB_NAME=/data/wakapi.db
|
2020-05-30 13:27:10 +03:00
|
|
|
ENV WAKAPI_PASSWORD_SALT ''
|
2021-01-07 12:04:36 +03:00
|
|
|
ENV WAKAPI_LISTEN_IPV4 '0.0.0.0'
|
|
|
|
ENV WAKAPI_INSECURE_COOKIES 'true'
|
2020-04-26 16:18:47 +03:00
|
|
|
|
2019-10-08 01:41:00 +03:00
|
|
|
COPY --from=build-env /src/wakapi /app/
|
2020-10-04 12:52:52 +03:00
|
|
|
COPY --from=build-env /src/config.default.yml /app/config.yml
|
2020-05-30 13:27:10 +03:00
|
|
|
COPY --from=build-env /src/version.txt /app/
|
2020-04-26 16:07:00 +03:00
|
|
|
|
2021-01-07 12:04:36 +03:00
|
|
|
RUN sed -i 's/listen_ipv6: ::1/listen_ipv6: /g' /app/config.yml
|
2020-04-26 16:07:00 +03:00
|
|
|
|
2019-10-08 01:41:00 +03:00
|
|
|
ADD static /app/static
|
2020-04-26 16:07:00 +03:00
|
|
|
ADD data /app/data
|
|
|
|
ADD migrations /app/migrations
|
|
|
|
ADD views /app/views
|
2019-10-08 01:41:00 +03:00
|
|
|
ADD wait-for-it.sh .
|
2020-04-26 16:07:00 +03:00
|
|
|
|
2020-04-26 16:18:47 +03:00
|
|
|
VOLUME /data
|
|
|
|
|
2020-10-25 09:21:41 +03:00
|
|
|
ENTRYPOINT ./wait-for-it.sh
|