-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
62 lines (57 loc) · 1.44 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
version: '3.5'
services:
app: &default-app
build:
dockerfile: Dockerfile
context: .
# Only will build development stage from our dockerfile
target: development
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules # exclude node modules
env_file:
- .env
# Run a command against the development stage of the image
command: yarn start:docker:dev
ports:
- ${APP_PORT}:${APP_PORT}
depends_on:
- db
- cache
jobs:
<<: *default-app
ports: []
command: yarn start:docker:jobs
processors:
<<: *default-app
ports: []
command: yarn start:docker:processors
db:
image: mysql:8.0
restart: always
hostname: ${MYSQL_HOST}
volumes:
- ./init:/docker-entrypoint-initdb.d
- ./.volumes/db/data:/var/lib/mysql
ports:
- "${MYSQL_PORT}:${MYSQL_PORT}"
environment:
MYSQL_TCP_PORT: ${MYSQL_PORT}
MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DB_NAME}
user: 'mysql'
cache:
image: redis:7.0-alpine
restart: always
hostname: ${REDIS_HOST}
ports:
- "${REDIS_PORT}:${REDIS_PORT}"
command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD}
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 60s
timeout: 10s
retries: 5
start_period: 30s
volumes:
- ./.volumes/cache/data:/data