-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.staging.yaml
75 lines (70 loc) · 2.51 KB
/
docker-compose.staging.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
version: "3.8"
networks:
escooters-staging:
driver: bridge
traefik-proxy:
external: true
volumes:
escooters-postgres-data:
name: escooters-postgres-data
escooters-redis-data:
name: escooters-redis-data
services:
app:
build:
context: ./environment/staging/app
dockerfile: Dockerfile
labels:
- "traefik.enable=${TRAEFIK_ENABLED}"
- "traefik.http.routers.escooters.rule=Host(`${TRAEFIK_HOST}`)"
- "traefik.http.routers.escooters.entrypoints=websecure"
- "traefik.http.routers.escooters.tls=true"
- "traefik.http.routers.escooters.tls.certresolver=lets-encrypt-resolver"
- "traefik.http.routers.escooters.middlewares=response-gzip-compress@file"
container_name: escooters-app-staging
working_dir: /application
volumes:
- ./environment/staging/app/nginx.conf:/etc/nginx/nginx.conf:ro
- ./environment/staging/app/php.ini:/usr/local/etc/php/conf.d/zzz-overrides.ini:ro
- ./environment/staging/app/php-fpm.conf:/usr/local/etc/php-fpm.d/zzz-overrides.conf:ro
- ./environment/staging/app/supervisord.conf:/etc/supervisor/custom-supervisord.conf:ro
- .:/application
ports:
- ${DOCKER_APP_HOST_PORT:-3851}:80
networks:
- escooters-staging
- traefik-proxy
restart: unless-stopped
depends_on:
database:
condition: service_healthy
database:
image: postgres:15.6-alpine3.19
container_name: escooters-db-staging
environment:
- POSTGRES_USER=${DB_USERNAME}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_DATABASE}
- PGDATA=/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready --dbname ${DB_DATABASE} --username ${DB_USERNAME}"]
interval: 3s
timeout: 3s
retries: 5
ports:
- ${DOCKER_DATABASE_HOST_PORT:-3853}:5432
volumes:
- escooters-postgres-data:/var/lib/postgresql/data
networks:
- escooters-staging
restart: unless-stopped
redis:
image: redis:7.2.4-alpine3.19
container_name: escooters-redis-staging
ports:
- ${DOCKER_REDIS_HOST_PORT:-3852}:6379
volumes:
- escooters-redis-data:/data
networks:
- escooters-staging
restart: unless-stopped