-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
108 lines (101 loc) · 2.79 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
102
103
104
105
106
107
108
version: '3.8'
services:
# These are the configurations for our Node app
# When Docker Compose starts this container it will automatically
# use the Dockerfile in the directory to configure it
app:
build:
context: .
dockerfile: Dockerfile
restart: always
container_name: api
depends_on:
- postgres
- mongodb
- pgadmin
ports:
- "8080:8080"
environment:
# Port of application running
- PORT=8080
# Private key for JWT signing
- JWTPrivateKey=secret
# Auth data for database
- DB_NAME=eshop
- DB_USER=postgres
- DB_PASSWORD=password
- DB_HOST=postgres
- DB_DIALECT=postgres
- DB_USE_LOGGING=true
# Auth data for mailer
- MAILER_HOSTNAME=mail.yandex.ru
- MAILER_PORT=465
- MAILER_USE_SECURED_CONNECTION=true
- MAILER_MAX_CONNECTIONS=10
- MAILER_AUTH_PASSWORD=eshopTesting
- MAILER_SITE_NAME=eShop-catalogue
# Auth data for mongo logger
- MONGO_HOST=mongodb
- MONGO_PORT=27017
- MONGO_COLLECTION=eshop
- MONGO_ACCESS_CONTROL_ENABLED=false
- MONGO_USER=root
- MONGO_PASSWORD=password
networks:
- app-network
# This is the configuration for our PostgreSQL database container
# Note the `postgres` name is important, in out Node app when we refer
# to `host: "postgres"` that value is mapped on the network to the
# address of this container.
postgres:
image: postgres:14.1-alpine
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
- POSTGRES_DB=eshop
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
#volumes:
# When the PostgresSQL container is started it will run any scripts
# provided in the `docker-entrypoint-initdb.d` directory, this connects
# our seed file to that directory so that it gets run
# - ./database-seed.sql:/docker-entrypoint-initdb.d/database-seed.sql
networks:
- app-network
# PostgreSQL pgAdmin panel accessible at http://localhost:16543/
pgadmin:
image: dpage/pgadmin4
environment:
- PGADMIN_DEFAULT_PASSWORD=password
ports:
- "5050:80"
depends_on:
- postgres
volumes:
- pgadmin-data:/var/lib/pgadmin
networks:
- app-network
mongodb:
image: mongo
restart: always
container_name: mongodb
environment:
- MONGO_INITDB_DATABASE=eshop
- MONGO_INITDB_USERNAME=root
- MONGO_INITDB_PASSWORD=password
ports:
- 27017:27017
networks:
- app-network
volumes:
pgadmin-data:
postgres-data:
driver: local
networks:
app-network:
driver: bridge