Skip to content

Commit b050de5

Browse files
committed
Update CI/CD workflow to use docker-compose.example.yaml for deployment
1 parent 3cba114 commit b050de5

File tree

2 files changed

+63
-1
lines changed

2 files changed

+63
-1
lines changed

.github/workflows/ci-cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ jobs:
7474
tags: abdulwaisa/booklibraryapi:latest
7575
- name: Deploy with Docker Compose
7676
run: |
77-
docker compose -f compose.yaml up -d
77+
docker compose -f docker-compose.example.yaml up -d

docker-compose.example.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
version: '3.8'
2+
services:
3+
app:
4+
image: abdulwaisa/booklibraryapi:latest
5+
container_name: booklibraryapi_app
6+
environment:
7+
- ASPNETCORE_ENVIRONMENT=Production
8+
- ConnectionStrings__LibraryDbConnection=Host=book-lib-postgres;Port=5432;Database=librarydb;Username=postgres;Password=postgres
9+
- ConnectionStrings__Redis=book-lib-redis:6379
10+
- Email__SmtpHost=mailpit
11+
- Email__SmtpPort=1025
12+
- Email__From=admin@example.com
13+
- ASPNETCORE_URLS=https://+:9443;http://+:8080
14+
- ASPNETCORE_Kestrel__Certificates__Default__Password=Password123!
15+
- ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnet-dev-cert.pfx
16+
ports:
17+
- "8080:8080"
18+
- "9443:9443"
19+
depends_on:
20+
- book-lib-postgres
21+
- book-lib-redis
22+
- mailpit
23+
restart: unless-stopped
24+
# If you need the dev certificate, mount it as a volume:
25+
# volumes:
26+
# - ./aspnet-dev-cert.pfx:/https/aspnet-dev-cert.pfx
27+
28+
book-lib-postgres:
29+
image: postgres:15.1
30+
container_name: BookLibrary.Postgres
31+
environment:
32+
POSTGRES_DB: librarydb
33+
POSTGRES_USER: postgres
34+
POSTGRES_PASSWORD: postgres
35+
ports:
36+
- "5432:5432"
37+
healthcheck:
38+
test: ["CMD-SHELL", "pg_isready -U postgres"]
39+
interval: 10s
40+
timeout: 5s
41+
retries: 5
42+
restart: unless-stopped
43+
44+
book-lib-redis:
45+
image: redis:7.0
46+
container_name: BookLibrary.Redis
47+
ports:
48+
- "6379:6379"
49+
healthcheck:
50+
test: ["CMD", "redis-cli", "ping"]
51+
interval: 10s
52+
timeout: 5s
53+
retries: 5
54+
restart: unless-stopped
55+
56+
mailpit:
57+
image: axllent/mailpit:latest
58+
container_name: mailpit
59+
ports:
60+
- "8025:8025" # Web UI
61+
- "3025:1025" # SMTP (host:container)
62+
restart: unless-stopped

0 commit comments

Comments
 (0)