2022-08-19 12:37:05 +03:00
|
|
|
FROM golang:1.18-alpine AS build-env
|
2020-10-25 09:21:41 +03:00
|
|
|
WORKDIR /src
|
2021-01-12 13:38:58 +03:00
|
|
|
|
2022-08-19 12:37:05 +03:00
|
|
|
# Required for go-sqlite3
|
|
|
|
RUN apk add --no-cache gcc musl-dev
|
2019-10-08 01:41:00 +03:00
|
|
|
|
2021-12-15 17:35:51 +03:00
|
|
|
RUN wget "https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh" -O wait-for-it.sh && \
|
2021-02-06 12:43:32 +03:00
|
|
|
chmod +x wait-for-it.sh
|
|
|
|
|
2022-08-19 12:37:05 +03:00
|
|
|
ADD ./go.mod ./go.sum ./
|
|
|
|
RUN go mod download
|
|
|
|
ADD . .
|
2022-01-03 04:01:29 +03:00
|
|
|
|
2022-09-08 22:13:13 +03:00
|
|
|
RUN CGO_ENABLED=0 go build -ldflags "-s -w" -v -o wakapi main.go
|
2020-04-26 16:18:47 +03:00
|
|
|
|
2022-08-19 14:55:58 +03:00
|
|
|
WORKDIR /staging
|
|
|
|
RUN mkdir ./data ./app && \
|
|
|
|
cp /src/wakapi app/ && \
|
|
|
|
cp /src/config.default.yml app/config.yml && \
|
|
|
|
sed -i 's/listen_ipv6: ::1/listen_ipv6: /g' app/config.yml && \
|
|
|
|
cp /src/wait-for-it.sh app/ && \
|
|
|
|
cp /src/entrypoint.sh app/
|
2021-01-12 13:38:58 +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
|
|
|
|
2021-12-15 17:35:51 +03:00
|
|
|
FROM alpine:3
|
2019-10-08 01:41:00 +03:00
|
|
|
WORKDIR /app
|
2020-04-26 16:07:00 +03:00
|
|
|
|
2022-01-03 03:16:17 +03:00
|
|
|
RUN apk add --no-cache bash ca-certificates tzdata
|
2021-01-24 23:39:35 +03:00
|
|
|
|
2021-04-11 13:42:43 +03:00
|
|
|
# See README.md and config.default.yml for all config options
|
2022-08-19 12:37:05 +03:00
|
|
|
ENV ENVIRONMENT=prod \
|
|
|
|
WAKAPI_DB_TYPE=sqlite3 \
|
|
|
|
WAKAPI_DB_USER='' \
|
|
|
|
WAKAPI_DB_PASSWORD='' \
|
|
|
|
WAKAPI_DB_HOST='' \
|
|
|
|
WAKAPI_DB_NAME=/data/wakapi.db \
|
|
|
|
WAKAPI_PASSWORD_SALT='' \
|
|
|
|
WAKAPI_LISTEN_IPV4='0.0.0.0' \
|
|
|
|
WAKAPI_INSECURE_COOKIES='true' \
|
|
|
|
WAKAPI_ALLOW_SIGNUP='true'
|
2020-04-26 16:18:47 +03:00
|
|
|
|
2022-08-19 14:55:58 +03:00
|
|
|
COPY --from=build-env /staging /
|
2020-04-26 16:07:00 +03:00
|
|
|
|
2022-03-01 10:12:31 +03:00
|
|
|
EXPOSE 3000
|
|
|
|
|
2021-12-15 17:35:51 +03:00
|
|
|
ENTRYPOINT /app/entrypoint.sh
|