services: server: build: context: . container_name: short-server volumes: - custom:/kutt/custom environment: DB_CLIENT: pg DB_HOST: postgres DB_PORT: 5432 REDIS_ENABLED: true REDIS_HOST: redis REDIS_PORT: 6379 depends_on: postgres: condition: service_healthy redis: condition: service_started networks: nginx_net: short_net: postgres: image: postgres container_name: short-postgres restart: always user: ${DB_USER} volumes: - db_data_pg:/var/lib/postgresql/data environment: POSTGRES_DB: ${DB_NAME} POSTGRES_PASSWORD: ${DB_PASSWORD} healthcheck: test: [ "CMD", "pg_isready" ] interval: 10s timeout: 5s retries: 5 networks: short_net: redis: image: redis:alpine container_name: short-redis restart: always networks: short_net: volumes: db_data_pg: custom: networks: short_net: nginx_net: external: true