-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathcompose.yaml
More file actions
45 lines (42 loc) · 1.18 KB
/
compose.yaml
File metadata and controls
45 lines (42 loc) · 1.18 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
name: dotnet-samples-aspnetcore-webapi
services:
api:
image: dotnet-samples-aspnetcore-webapi
container_name: aspnetcore-app
build:
context: .
dockerfile: Dockerfile
ports:
- "9000:9000"
volumes:
- storage:/storage/
environment:
- DATABASE_PROVIDER=${DATABASE_PROVIDER:-sqlite}
- DATABASE_URL=${DATABASE_URL:-Host=postgres;Database=players;Username=postgres;Password=postgres}
- STORAGE_PATH=/storage/players-sqlite3.db
depends_on:
postgres:
condition: service_healthy
required: false
restart: unless-stopped
postgres:
image: postgres:17-alpine
container_name: aspnetcore-postgres
profiles: [postgres]
environment:
POSTGRES_DB: players
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
volumes:
storage:
name: dotnet-samples-aspnetcore-webapi_storage
postgres-data:
name: dotnet-samples-aspnetcore-webapi_postgres-data