Skip to content

Commit 1e26e2f

Browse files
committed
chore: improve pino log messages
1 parent e0a48f1 commit 1e26e2f

File tree

10 files changed

+2109
-2298
lines changed

10 files changed

+2109
-2298
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
services:
2+
postgres:
3+
container_name: local-postgress
4+
image: postgres:13.16-bookworm
5+
environment:
6+
POSTGRES_USER: admin_pg
7+
POSTGRES_PASSWORD: password
8+
POSTGRES_DB: local-express-hybrid-auth-api-db
9+
ports:
10+
- '5433:5432'
11+
healthcheck:
12+
test: ['CMD-SHELL', 'pg_isready -U admin_pg -d local-express-hybrid-auth-api-db']
13+
interval: 5s
14+
timeout: 5s
15+
retries: 5
16+
start_period: 10s
17+
18+
redis:
19+
container_name: local-redis
20+
image: redis:6.0.18-alpine
21+
ports:
22+
- '6379:6379'
23+
24+
migrate:
25+
build:
26+
context: ../
27+
dockerfile: Dockerfile
28+
depends_on:
29+
postgres:
30+
condition: service_healthy
31+
environment:
32+
- DATABASE_URL=postgresql://admin_pg:password@postgres:5432/local-express-hybrid-auth-api-db
33+
- NODE_ENV=development
34+
command: >
35+
sh -c "
36+
echo 'PostgreSQL is healthy, running migrations...'
37+
npx prisma migrate reset --force
38+
"
39+
restart: 'no'
40+
41+
smtp4dev:
42+
container_name: local-smtp4dev
43+
image: rnwood/smtp4dev
44+
ports:
45+
- '5000:80' # Web UI
46+
- '2525:2525' # SMTP server
47+
restart: unless-stopped
48+
environment:
49+
- Logging__LogLevel__Default=Information

.devcontainer/docker-compose.prod.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ services:
77
dockerfile: Dockerfile
88
image: express-hybrid-auth-api:latest
99
depends_on:
10-
- postgres
11-
- redis
10+
postgres:
11+
condition: service_healthy
12+
redis:
13+
condition: service_started
14+
smtp4dev:
15+
condition: service_started
1216
ports:
13-
- '3000:3000'
17+
- '3001:3000'
1418
env_file:
1519
- .env.production.local
1620
restart: always
@@ -20,13 +24,13 @@ services:
2024
context: ../
2125
dockerfile: Dockerfile
2226
depends_on:
23-
- postgres
27+
postgres:
28+
condition: service_healthy
2429
env_file:
2530
- .env.production.local
2631
command: >
2732
sh -c "
28-
echo 'Waiting 2 seconds for Postgres to be ready...'
29-
sleep 3
33+
echo 'PostgreSQL is healthy, running migrations...'
3034
npx prisma migrate reset --force
3135
"
3236
restart: 'no'
@@ -42,6 +46,12 @@ services:
4246
restart: always
4347
ports:
4448
- '5433:5432'
49+
healthcheck:
50+
test: ['CMD-SHELL', 'pg_isready -U admin_pg -d express-hybrid-auth-api-local-prod-db']
51+
interval: 5s
52+
timeout: 5s
53+
retries: 5
54+
start_period: 10s
4555

4656
redis:
4757
image: redis:6.0.18-alpine
@@ -54,7 +64,7 @@ services:
5464
image: rnwood/smtp4dev
5565
ports:
5666
- '5000:80'
57-
- '2525:25'
67+
- '2525:2525'
5868
restart: unless-stopped
5969
environment:
6070
- Logging__LogLevel__Default=Information

.devcontainer/docker-compose.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.env.development

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PORT=3000
1+
PORT=3001
22
FRONTEND_URL=http://localhost:3000
33

44
DEBUG_LOG=true

0 commit comments

Comments
 (0)