This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
69 lines (63 loc) · 1.6 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
# ./docker-compose.yml
version: '3'
volumes:
pg-data:
driver: local
services:
client_db:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: password1
POSTGRES_USER: user
POSTGRES_DB: pgdb
volumes:
- pg-data:/var/lib/postgresql/data
#Not needed. Ports are exposed to other services in docker network by default. Only needed if need access from host machine
#ports:
#- "5432:5432"
client:
build:
context: ./consumer_client
dockerfile: Dockerfile
ports:
- 4000:4000
# Prisma schema needs to be pushed to db before starting dev app (2 commands)
command: sh -c "npx prisma db push && npm run dev"
volumes:
- ./consumer_client:/consumer_client/
- /consumer_client/node_modules
- /consumer_client/.next
stdin_open: true
tty: true
environment:
# Reference db by service name instead of using localhost
DATABASE_URL: "postgresql://user:password1@client_db:5432/pgdb"
depends_on:
- client_db
db:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: secret123
MYSQL_DATABASE: dev
MYSQL_USER: devuser
MYSQL_PASSWORD: devpass
MYSQL_ROOT_HOST: '%'
ports:
- "9906:3306"
volumes:
- ./db/mysql/data:/var/lib/mysql
- ./db/mysql/init:/docker-entrypoint-initdb.d/:ro
web:
image: php:8.0-apache
build:
context: ./php
dockerfile: Dockerfile
depends_on:
- db
volumes:
- ./php/:/var/www/html/
ports:
- "8100:80"
stdin_open: true
tty: true