-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
71 lines (65 loc) · 1.43 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# ! Docker-Compose Specification
version: '3.8'
# ! Define Project Network
networks:
app-network:
# ! Define Project Volume
volumes:
pgdata:
# ? App Stack
services:
# ? Bring up Nginx After Backend and Link Volumes
webserver:
image: nginx:1.21-alpine
container_name: webserver
restart: unless-stopped
ports:
- "${HTTP_PORT}"
volumes:
- ./:/var/www
- .docker/nginx:/etc/nginx/conf.d
networks:
- app-network
# ? Bring up Postgres and configure the Database
database:
image: postgres:14-alpine
container_name: database
restart: unless-stopped
tty: true
ports:
- "5432:5432"
environment:
- POSTGRES_USER=${DB_USERNAME}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_DATABASE}
- PGDATA=/var/lib/postgresql/data
volumes:
- pgdata:/var/lib/postgresql/data
networks:
- app-network
# ? Build, Bring up Backend Container
backend:
build:
context: .
dockerfile: php.dockerfile
container_name: backend
volumes:
- .:/var/www
- .docker/php-fpm/php.ini:/usr/local/etc/php/conf.d/local.ini
depends_on:
- database
networks:
- app-network
# ? Bring Up Client UI
client:
build:
context: .
dockerfile: npm.dockerfile
container_name: client
tty: true
volumes:
- ./:/app
depends_on:
- backend
networks:
- app-network