-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
117 lines (117 loc) · 3.09 KB
/
Copy pathdocker-compose.yml
File metadata and controls
117 lines (117 loc) · 3.09 KB
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
109
110
111
112
113
114
115
116
117
version: '3.7'
services:
proxy-reverse:
profiles: ['production']
container_name: ecommerce_proxy_reverse
image: nginx
ports:
- 80:80
restart: unless-stopped
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf
depends_on:
- api-rest-app
proxy-reverse-e2e:
profiles: ['testing', 'development']
container_name: ecommerce_proxy_reverse
image: nginx
ports:
- 80:80
restart: unless-stopped
volumes:
- ./infra/e2e/nginx.conf:/etc/nginx/conf.d/default.conf
api-rest-app:
profiles: ['production']
image: matheusinit/ecommerce-api
ports:
- 8000:8000
environment:
ACCESS_TOKEN_SECRET: ${ACCESS_TOKEN_SECRET}
REFRESH_TOKEN_SECRET: ${REFRESH_TOKEN_SECRET}
PORT: ${PORT}
REDIS_URL: ${REDIS_URL}
DATABASE_URL: ${DATABASE_URL}
MQ_URL: ${MQ_URL}
depends_on:
- database
- cache
- message-queue
api-rest-dev:
container_name: api-rest
profiles: ['development']
build:
context: .
target: production
ports:
- 8000:8000
environment:
ACCESS_TOKEN_SECRET: ${ACCESS_TOKEN_SECRET}
REFRESH_TOKEN_SECRET: ${REFRESH_TOKEN_SECRET}
PORT: ${PORT}
REDIS_URL: ${REDIS_URL}
DATABASE_URL: ${DATABASE_URL}
MQ_URL: ${MQ_URL}
SMTP_PROVIDER: ${SMTP_PROVIDER}
SMTP_PORT: ${SMTP_PORT}
SMTP_USER: ${SMTP_USER}
SMTP_PASSWORD: ${SMTP_PASSWORD}
depends_on:
- database
- cache
- message-queue
database:
profiles: ['production', 'development']
container_name: ecommerce_db
image: postgres:14
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- /usr/docker/postgresql/ecommerce/:/data/postgres
ports:
- "5432:5432"
restart: unless-stopped
cache:
profiles: ['production', 'development', 'testing']
image: redis:alpine
restart: unless-stopped
ports:
- "6379:6379"
command: redis-server --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD}
volumes:
- /usr/docker/cache/ecommerce/:/data
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD}
message-queue:
profiles: ['production', 'development']
image: rabbitmq:3-management
ports:
- 8080:15672
- 5672:5672
testing-database:
profiles: ['testing']
container_name: ecommerce_db_testing
image: postgres:14
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
POSTGRES_DB: ${POSTGRES_DB}
command: postgres -c fsync=off -c synchronous_commit=off -c full_page_writes=off -c random_page_cost=1.0
tmpfs: /var/lib/postgresql/data
env_file: .env.test.ci
ports:
- "5440:5432"
integration_tests:
profiles: ['testing']
container_name: ecommerce_integration_tests
build:
context: .
target: integration-test
env_file: .env.test.ci
depends_on:
- testing-database
- cache
volumes:
cache:
driver: local