Files
link-shortener/docker-compose.yml
Giovanni Rezcjikov 8befcc11c1
Some checks failed
continuous-integration/drone/push Build is failing
feat: increased security
2026-02-21 21:05:47 +03:00

71 lines
1.5 KiB
YAML

services:
link-shortener:
image: ${IMAGE}
container_name: link-shortener-app
networks:
- isolated
- proxy
depends_on:
redis:
condition: service_healthy
expose:
- 8080
environment:
- SERVER_HOST=${SERVER_HOST}
- VIRTUAL_HOST=${VIRTUAL_HOST}
- VIRTUAL_PORT=${VIRTUAL_PORT}
- LETSENCRYPT_HOST=${LETSENCRYPT_HOST}
- LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}
- SERVER_PORT=${SERVER_PORT}
- REDIS_URL=${REDIS_URL}
restart: unless-stopped
read_only: true
security_opt:
- no-new-privileges:true
deploy:
resources:
limits:
memory: 256M
cpus: '0.50'
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:8080/ping"]
interval: 5s
timeout: 2s
retries: 10
start_period: 10s
redis:
image: redis:7.4-alpine
container_name: link-shortener-redis
networks: [isolated]
restart: unless-stopped
read_only: true
security_opt:
- no-new-privileges:true
deploy:
resources:
limits:
memory: 256M
cpus: '0.50'
volumes:
- redis_data:/data
tmpfs:
- /tmp
command: ["redis-server", "--appendonly", "yes", "--requirepass", "${REDIS_PASSWORD}"]
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "ping"]
interval: 5s
timeout: 3s
retries: 5
start_period: 10s
volumes:
redis_data:
driver: local
networks:
isolated:
driver: bridge
proxy:
external: true