forked from FRRe-DS/2022-TPI-G3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
101 lines (97 loc) · 2.31 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
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
# docker-compose.yml
version: "3.7"
services:
api:
build:
dockerfile: Dockerfile
context: ./api
# Only will build development stage from our dockerfile
target: development
env_file:
- ./api/.env
environment:
- WAIT_HOSTS=mysqldb:3306
- DB_HOST=mysqldb
- DB_USER=root
- DB_PASSWORD=1234
- DB_NAME=fantur-ecommerce
- DB_PORT=3306
- DB_DIALECT=mysql
- PORT=8000
- EMAIL_HOST=$EMAIL_HOST
- EMAIL_USER=$EMAIL_USER
- EMAIL_PASSWORD=$EMAIL_PASSWORD
- DOCKER=DOCKER
# Run a command against the development stage of the image
container_name: dev-api
image: dhsosa98/api_dev:latest
command: sh -c "/wait && npx sequelize-cli db:drop && npx sequelize-cli db:create && npx sequelize-cli db:migrate && npx sequelize-cli db:seed:all && npm run start:dev"
ports:
- 8000:8000
depends_on:
- mysqldb
networks:
- backend
- frontend
stdin_open: true
tty: true
volumes:
- ./api:/usr/src/app/api/:rw
- /usr/src/app/api/node_modules
mem_reservation: 1024M
tourism_control:
image: frredacs/turismo-control:1.2
restart: unless-stopped
ports:
- 8080:8080
networks:
- backend
mem_reservation: 128M
mysqldb:
image: mysql:5.7
restart: unless-stopped
env_file: ./api/.env
environment:
- MYSQL_ROOT_PASSWORD=1234
- MYSQL_DATABASE=fantur-ecommerce
ports:
- 3007:3306
volumes:
- db:/var/lib/mysql
networks:
- backend
mem_reservation: 256M
ui:
build:
dockerfile: Dockerfile
context: ./front
# Only will build development stage from our dockerfile
target: front_development
env_file: ./api/.env
environment:
- VITE_API_BASE_URL=/api
# Run a command against the development stage of the image
image: dhsosa98/front_dev:latest
container_name: dev-front
command: npm run dev
networks:
- frontend
ports:
- 3000:3000
stdin_open: true
volumes:
- ./front:/usr/src/app/front/:rw
- /usr/src/app/front/node_modules
nginx:
build: ./nginx
image: dhsosa98/nginx_dev:latest
ports:
- 80:80
networks:
- frontend
restart: always
volumes:
db:
networks:
backend:
frontend: