-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
60 lines (58 loc) · 1.63 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
version: "3.8"
services:
# Database of the application (Postgres)
app-db:
image: postgres:latest
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: SampleDriverDb
TZ: Europe/Warsaw
ports:
- "${POSTGRES_PORT}:${POSTGRES_PORT}"
command: -p "${POSTGRES_PORT}"
restart: always
volumes:
- app_data:/var/lib/postgresql/data
networks:
- appnet
# Backend of the application (ASP.NET Core)
app-api:
build:
context: ./SampleAspNetReactDockerApp.Server
dockerfile: Dockerfile
ports:
- "${ASPNETCORE_APP_PORT}:${ASPNETCORE_APP_PORT}"
environment:
ASPNETCORE_ENVIRONMENT: "PRODUCTION"
ASPNETCORE_APP_DB: "${ASPNETCORE_APP_DB}"
ASPNETCORE_SHOW_SWAGGER_IN_PRODUCTION: "${ASPNETCORE_SHOW_SWAGGER_IN_PRODUCTION}"
ASPNETCORE_APP_PORT: "${ASPNETCORE_APP_PORT}"
CLIENT_APP_PORTS: "${CLIENT_APP_PORTS}"
POSTGRES_PORT: "${POSTGRES_PORT}"
depends_on:
- app-db
networks:
- appnet
# Frontend of the application (React-Vite)
app-client:
build:
context: ./SampleAspNetReactDockerApp.Client
dockerfile: Dockerfile
ports:
- "${CLIENT_APP_PORTS}"
environment:
ASPNETCORE_ENVIRONMENT: "PRODUCTION"
ASPNETCORE_APP_DB: "${ASPNETCORE_APP_DB}"
ASPNETCORE_SHOW_SWAGGER_IN_PRODUCTION: "${ASPNETCORE_SHOW_SWAGGER_IN_PRODUCTION}"
ASPNETCORE_APP_PORT: "${ASPNETCORE_APP_PORT}"
CLIENT_APP_PORTS: "${CLIENT_APP_PORTS}"
depends_on:
- app-api
networks:
- appnet
volumes:
app_data:
networks:
appnet:
driver: bridge