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

52 lines
1.2 KiB
Docker
Raw Normal View History

2019-10-08 10:08:52 +03:00
# Build Stage
2020-04-26 16:07:00 +03:00
FROM golang:1.13 AS build-env
2019-10-08 01:41:00 +03:00
ADD . /src
RUN cd /src && go build -o wakapi
2019-10-08 10:08:52 +03:00
# Final 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
# to override config values from .env using `-e` syntax.
# Available options are:
2020-04-26 16:07:00 +03:00
# WAKAPI_DB_TYPE
2019-10-08 10:08:52 +03:00
# WAKAPI_DB_USER
# WAKAPI_DB_PASSWORD
# WAKAPI_DB_HOST
2020-04-26 16:07:00 +03:00
# WAKAPI_DB_PORT
2019-10-08 10:08:52 +03:00
# WAKAPI_DB_NAME
2020-05-30 13:27:10 +03:00
# WAKAPI_PASSWORD_SALT
2020-04-26 16:07:00 +03:00
# WAKAPI_DEFAULT_USER_NAME
# WAKAPI_DEFAULT_USER_PASSWORD
FROM debian
2019-10-08 01:41:00 +03:00
WORKDIR /app
2020-04-26 16:07:00 +03:00
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
2020-05-30 13:27:10 +03:00
ENV WAKAPI_PASSWORD_SALT ''
ENV WAKAPI_DEFAULT_USER_NAME admin
ENV WAKAPI_DEFAULT_USER_PASSWORD admin
2019-10-08 01:41:00 +03:00
COPY --from=build-env /src/wakapi /app/
COPY --from=build-env /src/config.ini /app/
2020-05-30 13:27:10 +03:00
COPY --from=build-env /src/version.txt /app/
2019-10-08 01:41:00 +03:00
COPY --from=build-env /src/.env.example /app/.env
2020-04-26 16:07:00 +03:00
2019-10-08 01:41:00 +03:00
RUN sed -i 's/listen = 127.0.0.1/listen = 0.0.0.0/g' /app/config.ini
2020-05-30 13:27:10 +03:00
RUN sed -i 's/insecure_cookies = false/insecure_cookies = true/g' /app/config.ini
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
VOLUME /data
2019-10-08 01:41:00 +03:00
ENTRYPOINT ./wait-for-it.sh