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

53 lines
1.3 KiB
Docker
Raw Permalink Normal View History

2019-10-08 10:08:52 +03:00
# Build Stage
FROM golang:1.16-alpine AS build-env
WORKDIR /src
2021-01-12 13:38:58 +03:00
# Required for go-sqlite3
RUN apk add gcc musl-dev
ADD ./go.mod .
RUN go mod download
2019-10-08 01:41:00 +03:00
RUN wget "https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh" -O wait-for-it.sh && \
chmod +x wait-for-it.sh
ADD . .
RUN go build -o wakapi
2021-01-12 13:38:58 +03:00
WORKDIR /app
RUN cp /src/wakapi . && \
cp /src/config.default.yml config.yml && \
sed -i 's/listen_ipv6: ::1/listen_ipv6: /g' config.yml && \
cp /src/wait-for-it.sh . && \
cp /src/entrypoint.sh .
2021-01-12 13:38:58 +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
# to override config values using `-e` syntax.
# Available options can be found in [README.md#-configuration](README.md#-configuration)
2020-04-26 16:07:00 +03:00
FROM alpine:3
2019-10-08 01:41:00 +03:00
WORKDIR /app
2020-04-26 16:07:00 +03:00
RUN apk update && apk add bash ca-certificates tzdata && rm -rf /var/cache/apk
# See README.md and config.default.yml for all config options
ENV ENVIRONMENT 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_LISTEN_IPV4 '0.0.0.0'
ENV WAKAPI_INSECURE_COOKIES 'true'
2021-02-07 14:57:57 +03:00
ENV WAKAPI_ALLOW_SIGNUP 'true'
2021-01-12 13:38:58 +03:00
COPY --from=build-env /app .
2020-04-26 16:07:00 +03:00
VOLUME /data
ENTRYPOINT /app/entrypoint.sh