This repository has been archived by the owner on Jan 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yaml
142 lines (133 loc) · 4.18 KB
/
docker-compose.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
version: '3.4'
services:
php:
build:
context: './api'
target: 'dev'
environment:
COMPOSER_CACHE_DIR: '/home/composer/.cache/composer'
COMPOSER_HOME: '/home/composer/.config/composer'
PHP_CONF_DISPLAY_ERRORS: 1
PHP_CONF_DISPLAY_STARTUP_ERRORS: 1
PHP_CONF_ERROR_REPORTING: 32767
PHP_CONF_OPCACHE_VALIDATE_TIMESTAMP: 1
PHP_CONF_ZEND_ASSERTIONS: 1
PHP_IDE_CONFIG: 'serverName=app-skeleton-php'
XDEBUG_CONFIG: 'client_host=172.17.0.1'
XDEBUG_MODE: '${XDEBUG_MODE:-off}'
image: 'carcel/skeleton/dev:php'
user: '${HOST_USER_IDS:-1000:1000}'
volumes:
- './api:/srv/app:rw'
- '${HOST_COMPOSER_CACHE_DIR:-~/.cache/composer}:/home/composer/.cache/composer'
- '${HOST_COMPOSER_HOME:-~/.config/composer}:/home/composer/.config/composer'
working_dir: '/srv/app'
api-dev:
build:
context: './api'
target: 'dev'
command: 'php -S 0.0.0.0:8000'
environment:
PHP_CONF_DISPLAY_ERRORS: 1
PHP_CONF_DISPLAY_STARTUP_ERRORS: 1
PHP_CONF_ERROR_REPORTING: 32767
PHP_CONF_OPCACHE_VALIDATE_TIMESTAMP: 1
PHP_CONF_ZEND_ASSERTIONS: 1
PHP_IDE_CONFIG: 'serverName=app-skeleton-api'
XDEBUG_CONFIG: 'client_host=172.17.0.1'
XDEBUG_MODE: '${XDEBUG_MODE:-off}'
expose:
- '8000'
image: 'carcel/skeleton/dev:php'
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.api-dev.entrypoints=web'
- 'traefik.http.routers.api-dev.rule=Host(`skeleton-api.docker.localhost`)'
user: '${HOST_USER_IDS:-1000:1000}'
volumes:
- './api:/srv/app:rw'
working_dir: '/srv/app/public'
fpm:
build:
context: './api'
target: 'api-fpm'
command: 'php-fpm -F'
image: 'carcel/skeleton/api:fpm'
restart: 'always'
api:
build:
context: './api'
target: 'api-nginx'
depends_on:
- fpm
image: 'carcel/skeleton/api:nginx'
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.api.entrypoints=websecure'
- 'traefik.http.routers.api.rule=Host(`skeleton-api.docker.localhost`)'
- 'traefik.http.routers.api.tls=true'
restart: on-failure
database:
environment:
POSTGRES_DB: '${PGSQL_DB:-app_skeleton}'
POSTGRES_USER: '${PGSQL_USERNAME:-app_skeleton}'
POSTGRES_PASSWORD: '${PGSQL_PASSWORD:-app_skeleton}'
image: 'postgres:13'
ports:
- '5432:5432'
restart: unless-stopped
node:
environment:
YARN_CACHE_FOLDER: '/home/yarn-cache'
image: 'node:slim'
user: '${HOST_USER_IDS:-1000:1000}'
volumes:
- './client:/srv/app'
- '${HOST_YARN_CACHE_FOLDER:-~/.cache/yarn}:/home/yarn-cache'
- '${HOST_YARN_CONFIG_FOLDER:-~/.yarn}:/.yarn'
- '${HOST_YARN_CONFIG_FILE:-~/.yarnrc}:/.yarnrc'
working_dir: '/srv/app'
client-dev:
command: 'yarn start'
environment:
REACT_APP_API_BASE_URL: 'http://skeleton-api.docker.localhost'
expose:
- '3000'
image: 'node:slim'
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.client-dev.entrypoints=web'
- 'traefik.http.routers.client-dev.rule=Host(`skeleton.docker.localhost`)'
- 'traefik.http.routers.client-dev.rule=PathPrefix(`/`)'
restart: on-failure
tty: true
user: '${HOST_USER_IDS:-1000:1000}'
volumes:
- './client:/srv/app'
working_dir: '/srv/app'
client:
build:
args:
API_BASE_URL_FOR_PRODUCTION: 'https://skeleton-api.docker.localhost'
context: './client'
target: 'client'
image: 'carcel/skeleton/client:latest'
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.client.entrypoints=websecure'
- 'traefik.http.routers.client.rule=Host(`skeleton.docker.localhost`)'
- 'traefik.http.routers.client.rule=PathPrefix(`/`)'
- 'traefik.http.routers.client.tls=true'
restart: on-failure
traefik:
image: 'traefik'
ports:
- '80:80'
- '443:443'
- '8080:8080'
restart: always
volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
- './traefik/dynamic:/etc/traefik/dynamic:ro'
- './traefik/ssl:/etc/traefik/ssl:ro'
- './traefik/traefik.yaml:/etc/traefik/traefik.yaml:ro'