Browse Source

ci: harden docker compose

Signed-off-by: rare-magma <rare-magma@posteo.eu>
pull/3614/head
rare-magma 1 year ago
parent
commit
f9def42025
Failed to extract signature
  1. 50
      docker/docker-compose.yml

50
docker/docker-compose.yml

@ -1,7 +1,19 @@
services: services:
ghostfolio: ghostfolio:
image: ghostfolio/ghostfolio:latest image: docker.io/ghostfolio/ghostfolio/ghostfolio:latest
init: true init: true
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
# uncomment to set resource usage limits
# deploy:
# resources:
# limits:
# cpus: "4"
# memory: 500m
# pids: 1024
env_file: env_file:
- ../.env - ../.env
environment: environment:
@ -16,8 +28,26 @@ services:
condition: service_healthy condition: service_healthy
redis: redis:
condition: service_healthy condition: service_healthy
postgres: postgres:
image: postgres:15 image: docker.io/library/postgres:15
cap_drop:
- ALL
cap_add:
- CHOWN
- DAC_READ_SEARCH
- FOWNER
- SETGID
- SETUID
security_opt:
- no-new-privileges:true
# uncomment to set resource usage limits
# deploy:
# resources:
# limits:
# cpus: "2"
# memory: 250m
# pids: 1024
env_file: env_file:
- ../.env - ../.env
healthcheck: healthcheck:
@ -27,8 +57,22 @@ services:
retries: 5 retries: 5
volumes: volumes:
- postgres:/var/lib/postgresql/data - postgres:/var/lib/postgresql/data
redis: redis:
image: redis:alpine cap_drop:
- ALL
cap_add:
- DAC_OVERRIDE
security_opt:
- no-new-privileges:true
# uncomment to set resource usage limits
# deploy:
# resources:
# limits:
# cpus: "2"
# memory: 250m
# pids: 1024
image: docker.io/library/redis:alpine
env_file: env_file:
- ../.env - ../.env
command: ['redis-server', '--requirepass', $REDIS_PASSWORD] command: ['redis-server', '--requirepass', $REDIS_PASSWORD]

Loading…
Cancel
Save