This repository has been archived by the owner on Aug 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
84 lines (77 loc) · 2.1 KB
/
docker-compose.prod.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
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
services:
nginx:
build:
context: .
target: nginx
dockerfile: Dockerfile.prod
container_name: nginx
ports:
- 80:80
- 443:443
volumes:
- .:/var/www/html
depends_on:
- php
- mysql
networks:
- curriculum-mapping-tool
php:
container_name: php
build:
context: .
target: php
dockerfile: Dockerfile.prod
ports:
- 9000:9000 #this port is exposed so that the "fastcgi_pass" param in the nginx config can access the php container
volumes:
- .:/var/www/html
networks:
- curriculum-mapping-tool
mysql:
container_name: mysql
image: mysql:8.0
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
MYSQL_DATABASE: '${DB_DATABASE}'
MYSQL_USER: '${DB_USERNAME}'
MYSQL_PASSWORD: '${DB_PASSWORD}'
volumes:
- curriculum-mapping-tool-mysql:/var/lib/mysql
healthcheck:
test:
- CMD
- mysqladmin
- ping
- '-p${DB_PASSWORD}'
retries: 3
timeout: 5s
networks:
- curriculum-mapping-tool
composer:
container_name: composer
image: composer:latest
volumes:
- .:/var/www/html
working_dir: /var/www/html
user: 33:33 # because www-data is 82:82 in alpine linux, so we change it to be consistent with www-data id and group id on host machine
entrypoint: ['composer']
depends_on:
- php
networks:
- curriculum-mapping-tool
npm:
container_name: npm
image: node:20.15
volumes:
- .:/var/www/html
working_dir: /var/www/html
user: 'node'
entrypoint: ['npm']
networks:
curriculum-mapping-tool:
driver: bridge
volumes:
curriculum-mapping-tool-mysql:
driver: local