-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
101 lines (96 loc) · 2.42 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
version: "3.7"
services:
mysqldb:
image: mysql:5.7
env_file: ./.env
container_name: db
restart: always
environment:
- MYSQL_ROOT_PASSWORD=$DB_PASSWORD
- MYSQL_DATABASE=$DB_DATABASE
- MYSQL_USER=$DB_USERNAME
ports:
- $DB_PORT:$DB_PORT
volumes:
- db:/var/lib/mysql
- ./create_db.sql:/docker-entrypoint-initdb.d/create_dbdoc.sql
networks:
- node-network
app:
depends_on:
- mysqldb
container_name: app
build: .
restart: always
env_file: ./.env
ports:
- "8000:8000"
environment:
- WAIT_FOR_DB=true
- DB_HOST=mysqldb
- DB_USER=$DB_USERNAME
- DB_PASSWORD=$DB_PASSWORD
- DB_NAME=$DB_DATABASE
- DB_PORT=$DB_PORT
stdin_open: true
tty: true
networks:
- node-network
nginx:
restart: always
image: nginx:alpine
container_name: nginx
volumes:
- "./nginx-node/default.conf:/etc/nginx/conf.d/default.conf"
ports:
- "9000:80"
links:
- "app:app"
networks:
- node-network
# nginx:
# image: nginx:alpine
# container_name: nginx
# restart: unless-stopped
# build:
# context: ./nginx-node
# networks:
# - node-network
# # depends_on:
# # - app
# ports:
# - 80:80
# volumes:
# - ./nginx-node:/etc/nginx/conf.d
e2e:
image: cypress
build: ./e2e
container_name: cypress
depends_on:
- nginx
# note: inside e2e container, the network allows accessing
# "web" host under name "web"
# so "curl http://web" would return whatever the webserver
# in the "web" container is cooking
# see https://docs.docker.com/compose/networking/
environment:
- CYPRESS_baseUrl=http://localhost:9000
command: npx cypress run
# mount the host directory e2e/cypress and the file e2e/cypress.json as
# volumes within the container
# this means that:
# 1. anything that Cypress writes to these folders (e.g., screenshots,
# videos) appears also on the Docker host's filesystem
# 2. any change that the developer applies to Cypress files on the host
# machine immediately takes effect within the e2e container (no docker
# rebuild required).
volumes:
- ./cypress:/app/cypress
- ./cypress.json:/app/cypress.json
networks:
- node-network
volumes:
db:
networks:
node-network:
driver: bridge