From 1e3b027367c63919b7a9ad59386df6236365166d Mon Sep 17 00:00:00 2001 From: shibao Date: Fri, 25 Feb 2022 21:35:22 -0500 Subject: [PATCH] fix docker files --- Dockerfile | 9 +++++---- docker-compose.yml | 25 +++++++++++++++++++++---- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index a5cb72f1..80d8b664 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM elixir:1.12.2-alpine AS build +FROM elixir:1.13-alpine AS build # install build dependencies RUN apk add --no-cache build-base npm git python3 @@ -34,7 +34,7 @@ RUN mix do phx.digest, gettext.extract RUN mix do compile, release # prepare release image -FROM alpine:3.9 AS app +FROM alpine:latest AS app RUN apk upgrade --no-cache && \ apk add --no-cache bash openssl libgcc libstdc++ ncurses-libs @@ -45,8 +45,9 @@ RUN chown nobody:nobody /app USER nobody:nobody -COPY --from=build --chown=nobody:nobody /app/_build/prod/rel/lokal /app -COPY --from=build /app/priv/ /app/priv +COPY --from=build --chown=nobody:nobody /app/_build/prod/rel/lokal ./ +COPY --from=build --chown=nobody:nobody /app/priv /app/priv +RUN chmod +x /app/priv/random.sh ENV HOME=/app diff --git a/docker-compose.yml b/docker-compose.yml index 34d9bfa7..00dc0488 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,9 +7,26 @@ services: container_name: lokal restart: always environment: - - DATABASE_URL="ecto://postgres:postgres@lokal-db/lokal" - # generate a random base64 string 64 characters long, preferably not from a website - - SECRET_KEY_BASE="change-me-to-something-random-this-is-really-important-change-it" + # HOST must be set! + # - HOST=your.domain.com + - DATABASE_URL=ecto://postgres:postgres@lokal-db/lokal + # Use `docker run -it shibaobun/lokal /app/priv/random.sh` to generate a secret key base + # - SECRET_KEY_BASE=change-me-this-is-really-important-seriously-change-it + # uncomment to enable public sign ups, not recommended + # - REGISTRATION=public + # SMTP host must be set! + # - SMTP_HOST=smtp.mailserver.tld + # optional, default is 587 + # - SMTP_PORT=587 + # SMTP username/passwords must be set! + # - SMTP_USERNAME=username + # - SMTP_PASSWORD=password + # optional, default is false + # - SMTP_SSL=false + # optional, default is format below + # - EMAIL_FROM=no-reply@lokal.example.tld + # optional, default is "Lokal" + # - EMAIL_NAME=Lokal expose: - "4000" depends_on: @@ -18,10 +35,10 @@ services: lokal-db: image: postgres:13 container_name: lokal-db - restart: always environment: - POSTGRES_USER="postgres" - POSTGRES_PASSWORD="postgres" - POSTGRES_DB="lokal" + restart: always volumes: - ./data:/var/lib/postgresql/data