diff --git a/Dockerfile b/Dockerfile index 94346edcf..0ce08eda7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -56,10 +56,7 @@ RUN ln -s $HOME/bin/pleroma_ctl /bin/akkoma_ctl ADD docker-entrypoint.sh $HOME/docker-entrypoint.sh -RUN adduser --system --home $HOME akkoma -USER akkoma - -ENV AKKOMA_CONFIG_PATH=/opt/akkoma/config/config.exs +ENV AKKOMA_CONFIG_PATH=/opt/akkoma/config/prod.secret.exs VOLUME uploads /opt/akkoma/uploads VOLUME instance /opt/akkoma/instance VOLUME config /opt/akkoma/config diff --git a/docker-compose.yml b/docker-compose.yml index 1b40f9086..57fe1457e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,6 +3,8 @@ services: image: postgres:16-alpine shm_size: 4gb restart: unless-stopped + env_file: + - .env environment: { # This might seem insecure but is usually not a problem. # You should leave this at the "akkoma" default. @@ -14,13 +16,14 @@ services: POSTGRES_USER: akkoma, POSTGRES_PASSWORD: akkoma, } + user: ${DOCKER_USER} volumes: - ./pgdata:/var/lib/postgresql/data:z - akkoma: image: akkoma/akkoma:next restart: unless-stopped + user: ${DOCKER_USER} links: - db ports: [ @@ -34,9 +37,9 @@ services: "127.0.0.1:4000:4000", ] volumes: - - ./config:/opt/akkoma/config:z - - ./uploads:/opt/akkoma/uploads:z - - ./instance:/opt/akkoma/instance:z + - ./config:/opt/akkoma/config + - ./uploads:/opt/akkoma/uploads + - ./instance:/opt/akkoma/instance # Copy this into docker-compose.override.yml and uncomment there if you want to use a reverse proxy #proxy: diff --git a/docker-resources/generate-instance.sh b/docker-resources/generate-instance.sh index 387975100..949ed1b6f 100755 --- a/docker-resources/generate-instance.sh +++ b/docker-resources/generate-instance.sh @@ -3,7 +3,6 @@ set -euo pipefail mkdir -p pgdata -mkdir -p docker-setup-tmp # This is sorta special in that we need the generated_config.exs to make it onto the host # We can also automate the DB setup here! @@ -22,6 +21,6 @@ docker compose start db docker compose run \ --rm \ -e "PGPASSWORD=akkoma" \ - -v "$(pwd)/docker-setup-tmp/setup_db.psql:/docker-entrypoint-initdb.d/setup_db.sql" \ + -v "$(pwd)/config:/docker-entrypoint-initdb.d" \ db