-
Notifications
You must be signed in to change notification settings - Fork 173
/
docker-compose.yml
54 lines (49 loc) · 1.27 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
version: '3'
services:
app:
container_name: full_app
build: .
ports:
- 8080:8080 # Forward the exposed port 8080 on the container to port 8080 on the host machine
restart: on-failure
volumes:
- api:/usr/src/app/
depends_on:
- postgres # This service depends on postgres. Start that first.
# - mysql # This service depends on mysql. Start that first.
networks:
- fullstack
postgres:
image: postgres:latest
container_name: full_db
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME}
- DATABASE_HOST=${DB_HOST}
ports:
- '5432:5432'
volumes:
- database_postgres:/var/lib/postgresql/data
networks:
- fullstack
# mysql:
# image: mysql:5.7
# ports:
# - 3306:3306
# environment:
# - MYSQL_DATABASE=${DB_NAME}
# - MYSQL_USER=${DB_USER}
# - MYSQL_PASSWORD=${DB_PASSWORD}
# - MYSQL_ROOT_PASSWORD=${DB_PASSWORD}
# - DATABASE_HOST=${DB_HOST}
# volumes:
# - database_mysql:/var/lib/postgresql/data
# networks:
# - fullstack
volumes:
api:
database_postgres:
# Networks to be created to facilitate communication between containers
networks:
fullstack: