-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
55 lines (51 loc) · 1.72 KB
/
docker-compose.yml
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
version: '3.7'
services:
php:
build:
context: .
target: api_platform_php
restart: always
depends_on:
- db
volumes:
- .:/srv/api:rw,cached
api:
build:
context: .
target: api_platform_nginx
restart: always
depends_on:
- php
volumes:
- ./public:/srv/api/public:ro
labels:
- "traefik.enable=true"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-http.entrypoints=web"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-http.rule=Host(`${HOST_URL}`)"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-http.middlewares=redirect-to-https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.permanent=true"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.entrypoints=websecure"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.rule=Host(`${HOST_URL}`)"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.tls=true"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.tls.certresolver=${TRAEFIK_CERT_RESOLVER}"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.service=${COMPOSE_PROJECT_NAME}"
- "traefik.http.services.${COMPOSE_PROJECT_NAME}.loadbalancer.server.port=80"
- "traefik.docker.network=${TRAEFIK_NETWORK}"
networks:
- traefik
- default
db:
# In production, you may want to use a managed database service
image: postgres:10-alpine
restart: always
environment:
- POSTGRES_DB=api
- POSTGRES_USER=api-platform
- POSTGRES_PASSWORD=!ChangeMe!
volumes:
- ./docker/db/data:/var/lib/postgresql/data:rw
networks:
traefik:
name: ${TRAEFIK_NETWORK}
external: true