Browse Source

fix: docker compose works against latest docker

pull/4101/head
Lennart Goedhart 9 months ago
committed by Thomas Kaul
parent
commit
b749fa3bfb
  1. 4
      .env.example
  2. 22
      docker/docker-compose.yml

4
.env.example

@ -1,7 +1,7 @@
COMPOSE_PROJECT_NAME=ghostfolio COMPOSE_PROJECT_NAME=ghostfolio
# CACHE # CACHE
REDIS_HOST=localhost REDIS_HOST=redis
REDIS_PORT=6379 REDIS_PORT=6379
REDIS_PASSWORD=<INSERT_REDIS_PASSWORD> REDIS_PASSWORD=<INSERT_REDIS_PASSWORD>
@ -12,5 +12,5 @@ POSTGRES_PASSWORD=<INSERT_POSTGRES_PASSWORD>
# VARIOUS # VARIOUS
ACCESS_TOKEN_SALT=<INSERT_RANDOM_STRING> ACCESS_TOKEN_SALT=<INSERT_RANDOM_STRING>
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:5432/${POSTGRES_DB}?connect_timeout=300&sslmode=prefer DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?connect_timeout=300&sslmode=prefer
JWT_SECRET_KEY=<INSERT_RANDOM_STRING> JWT_SECRET_KEY=<INSERT_RANDOM_STRING>

22
docker/docker-compose.yml

@ -3,6 +3,7 @@ services:
ghostfolio: ghostfolio:
image: docker.io/ghostfolio/ghostfolio:latest image: docker.io/ghostfolio/ghostfolio:latest
container_name: ghostfolio container_name: ghostfolio
restart: unless-stopped
init: true init: true
cap_drop: cap_drop:
- ALL - ALL
@ -10,10 +11,6 @@ services:
- no-new-privileges:true - no-new-privileges:true
env_file: env_file:
- ../.env - ../.env
environment:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?connect_timeout=300&sslmode=prefer
REDIS_HOST: redis
REDIS_PASSWORD: ${REDIS_PASSWORD}
ports: ports:
- 3333:3333 - 3333:3333
depends_on: depends_on:
@ -28,8 +25,9 @@ services:
retries: 5 retries: 5
postgres: postgres:
image: docker.io/library/postgres:15 image: docker.io/library/postgres:15-alpine
container_name: gf-postgres container_name: gf-postgres
restart: unless-stopped
cap_drop: cap_drop:
- ALL - ALL
cap_add: cap_add:
@ -43,7 +41,7 @@ services:
env_file: env_file:
- ../.env - ../.env
healthcheck: healthcheck:
test: ['CMD-SHELL', 'pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}'] test: [ 'CMD-SHELL', 'pg_isready -d "$${POSTGRES_DB}" -U $${POSTGRES_USER}' ]
interval: 10s interval: 10s
timeout: 5s timeout: 5s
retries: 5 retries: 5
@ -53,6 +51,7 @@ services:
redis: redis:
image: docker.io/library/redis:alpine image: docker.io/library/redis:alpine
container_name: gf-redis container_name: gf-redis
restart: unless-stopped
user: '999:1000' user: '999:1000'
cap_drop: cap_drop:
- ALL - ALL
@ -60,9 +59,16 @@ services:
- no-new-privileges:true - no-new-privileges:true
env_file: env_file:
- ../.env - ../.env
command: ['redis-server', '--requirepass', $REDIS_PASSWORD] command:
- /bin/sh
- -c
# - Double dollars, so that the variable is not expanded by Docker Compose
# - Surround by quotes, so that the shell does not split the password
# - The ${variable:?message} syntax causes shell to exit with a non-zero
# code and print a message, when the variable is not set or empty
- redis-server --requirepass "$${REDIS_PASSWORD:?REDIS_PASSWORD variable is not set}"
healthcheck: healthcheck:
test: ['CMD-SHELL', 'redis-cli --pass "$REDIS_PASSWORD" ping | grep PONG'] test: [ 'CMD-SHELL', 'redis-cli --pass "$${REDIS_PASSWORD}" ping | grep PONG' ]
interval: 10s interval: 10s
timeout: 5s timeout: 5s
retries: 5 retries: 5

Loading…
Cancel
Save