-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.traefik.yml
More file actions
52 lines (48 loc) · 1.85 KB
/
docker-compose.traefik.yml
File metadata and controls
52 lines (48 loc) · 1.85 KB
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
# Update file with correct Docker image paths (from file .gitlab-ci.yml), map folders, port mapping
# map port from Docker host to [container](https://docs.docker.com/compose/compose-file/).
# If you going to have access from "world" to stage you should define public port.
# For example: we want to public nginx to world, to do this add port-mapping instruction in service nginx,
# but you should use variable "NGINX" instead certain TCP port. By default port will generated from range 20000-30000.
# Generate a random port (s) is performed in Ansible-playbook deploy_staging.yml.
# See documentation for deploy_staging.yml for more information.
version: "3.9"
services:
# NGINX container
mycard:
container_name: ${APP_NAME}
restart: unless-stopped
build:
context: .docker/traefik/nginx
dockerfile: Dockerfile
restart: 'unless-stopped'
volumes:
- .:/var/www/${APP_NAME}
- .docker/traefik/nginx/logs:/var/log/nginx
links:
- php
labels:
- "traefik.enable=true"
- "traefik.http.routers.${APP_NAME}.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.${APP_NAME}.entrypoints=websecure"
- "traefik.http.routers.${APP_NAME}.tls.certresolver=myresolver"
- "traefik.http.routers.${APP_NAME}.tls.domains[0].main=${DOMAIN}"
- "traefik.http.routers.${APP_NAME}.tls.domains[0].sans=www.${DOMAIN}"
# PHP FastCGI Process Manager container
php:
container_name: ${APP_NAME}-php
restart: unless-stopped
build:
context: .
dockerfile: .docker/traefik/php/Dockerfile
args:
- APP_ENV=${APP_ENV}
- APP_NAME=${APP_NAME}
volumes:
- .:/var/www/${APP_NAME}
- .docker/traefik/php/php.ini:/usr/traefik/etc/php/php.ini
labels:
- traefik.enable=false
networks:
default:
external:
name: traefik