-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
66 lines (62 loc) · 1.53 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
services:
app:
container_name: flo_app
build:
context: .
dockerfile: Dockerfile
expose:
- 8080
ports:
- "8080:8080"
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_HOST: 'flo-net-postgres'
GIN_MODE: ${GIN_MODE}
POSTGRES_PORT: 5432
links:
- flo-net-postgres
volumes:
- api:/usr/src/app/
depends_on:
- flo-net-postgres
networks:
- flo-net
flo-net-postgres:
image: postgres:latest
container_name: flo_db_postgres
restart: always
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
# - DATABASE_HOST=${DB_HOST}
ports:
- "5432:5432"
volumes:
- flo_database_postgres:/var/lib/postgresql/data
# - ./create-tables.sql:/docker-entrypoint-initdb.d/create-tables.sql
networks:
- flo-net
# pgadmin:
# image: dpage/pgadmin4
# container_name: pgadmin_container
# environment:
# PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
# PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
# depends_on:
# - flo-net-postgres
# ports:
# - "5050:80"
# networks:
# - flo-net
# restart: unless-stopped
volumes:
api:
flo_database_postgres:
# Networks to be created to facilitate communication between containers
networks:
flo-net:
driver: bridge