-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
106 lines (103 loc) · 3.77 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
version: "3.6"
networks:
techstore/in.production: {}
techstore/production: {}
secrets:
db_user:
file: ./docker/secrets/db_user
db_password:
file: ./docker/secrets/db_password
cd_api_key:
file: ./docker/secrets/cd_api_key
cd_api_secret:
file: ./docker/secrets/cd_api_secret
cd_cloud_name:
file: ./docker/secrets/cd_cloud_name
services:
database:
image: postgres:latest
container_name: techstore_database
hostname: ${DATABASE_HOSTNAME}
secrets:
- db_user
- db_password
labels:
edu.cibertec.techstore.project: "TechStore"
edu.cibertec.techstore.version: "1.0"
edu.cibertec.techstore.author.name: "Christian Rivera"
edu.cibertec.techstore.author.email: "[email protected]"
edu.cibertec.techstore.author.url: "https://github.com/pSharpX"
edu.cibertec.techstore.author.description: "TechStore Application"
networks:
- techstore/in.production
ports:
- "5432:5432"
restart: always
environment:
POSTGRES_USER_FILE: /run/secrets/db_user
POSTGRES_PASSWORD_FILE: /run/secrets/db_password
POSTGRES_DB: ${DATABASE_NAME}
volumes:
- ./data/db-scripts/:/docker-entrypoint-initdb.d/
- ./data/db/:/var/lib/postgresql/data
api:
build:
context: ./
dockerfile: Dockerfile
image: psharpx/techstore-api:${TAG}
container_name: api_techstore
hostname: ${API_HOSTNAME}
secrets:
- db_user
- db_password
- cd_api_key
- cd_api_secret
- cd_cloud_name
labels:
edu.cibertec.techstore.project: "TechStore"
edu.cibertec.techstore.version: "1.0"
edu.cibertec.techstore.author.name: "Christian Rivera"
edu.cibertec.techstore.author.email: "[email protected]"
edu.cibertec.techstore.author.url: "https://github.com/pSharpX"
edu.cibertec.techstore.author.description: "TechStore Application"
networks:
- techstore/in.production
restart: always
environment:
DB_TYPE: ${DATABASE_TYPE}
DB_HOST: ${DATABASE_HOSTNAME}
DB_PORT: ${DATABASE_PORT}
DB_USERNAME: "{{DOCKER-SECRET:db_user}}"
DB_PASSWORD: "{{DOCKER-SECRET:db_password}}"
DB_DATABASE: ${DATABASE_NAME}
CD_CLOUD_NAME: "{{DOCKER-SECRET:cd_cloud_name}}"
CD_UPLOAD_PRESET: ${CD_UPLOAD_PRESET}
CD_API_KEY: "{{DOCKER-SECRET:cd_api_key}}"
CD_API_SECRET: "{{DOCKER-SECRET:cd_api_secret}}"
depends_on:
- database
server:
image: nginx:1.21.3-alpine
container_name: integration_techstore
hostname: ${SERVER_HOSTNAME}
labels:
edu.cibertec.techstore.project: "TechStore"
edu.cibertec.techstore.version: "1.0"
edu.cibertec.techstore.author.name: "Christian Rivera"
edu.cibertec.techstore.author.email: "[email protected]"
edu.cibertec.techstore.author.url: "https://github.com/pSharpX"
edu.cibertec.techstore.author.description: "TechStore Application"
environment:
NGINX_PORT: ${NGINX_PORT}
API_DOMAIN_NAME: ${API_HOSTNAME}
API_PORT: ${API_PORT}
SERVER_NAME: ${SERVER_HOSTNAME}
networks:
- techstore/in.production
- techstore/production
volumes:
- ./docker/config/vhost_server.conf.template:/etc/nginx/templates/default.conf.template
ports:
- "8080:80"
depends_on:
- api