-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
119 lines (110 loc) · 2.63 KB
/
docker-compose.yml
File metadata and controls
119 lines (110 loc) · 2.63 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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
version: "3.8"
services:
# RabbitMQ Message Broker
rabbitmq:
image: rabbitmq:4-alpine
container_name: auth-rabbitmq
restart: unless-stopped
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
RABBITMQ_DEFAULT_VHOST: /
ports:
- "5672:5672"
- "15672:15672"
volumes:
- rabbitmq_data:/var/lib/rabbitmq
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- auth-network
# PostgreSQL Database
postgres:
image: postgres:18-alpine
container_name: auth-postgres
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: auth_db
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
networks:
- auth-network
# Auth Service Backend
backend:
build:
context: .
dockerfile: Dockerfile
target: development
container_name: auth-backend
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
environment:
SERVER_PORT: 8080
SERVER_HOST: 0.0.0.0
ENV: development
DB_HOST: postgres
DB_PORT: 5432
DB_USER: postgres
DB_PASSWORD: postgres
DB_NAME: auth_db
DB_SSL_MODE: disable
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: ""
REDIS_DB: 0
# RabbitMQ
RABBITMQ_HOST: rabbitmq
RABBITMQ_PORT: 5672
RABBITMQ_USER: guest
RABBITMQ_PASSWORD: guest
RABBITMQ_VHOST: /
# JWT
JWT_PRIVATE_KEY_PATH: ./keys/private.pem
JWT_PUBLIC_KEY_PATH: ./keys/public.pem
ACCESS_TOKEN_DURATION: 15m
REFRESH_TOKEN_DURATION: 168h
# Security
BCRYPT_COST: 12
RATE_LIMIT_LOGIN: 5
RATE_LIMIT_WINDOW: 15m
# CORS
CORS_ALLOWED_ORIGINS: http://localhost:3000,http://localhost:3001
CORS_ALLOWED_METHODS: GET,POST,PUT,DELETE,OPTIONS
CORS_ALLOWED_HEADERS: Content-Type,Authorization
ports:
- "8080:8080"
volumes:
# Mount source code for hot reload
- .:/app
# Exclude tmp directory (Air uses this)
- /app/tmp
# Cache Go modules
- go-modules:/go/pkg/mod
networks:
- auth-network
volumes:
postgres_data:
driver: local
rabbitmq_data:
driver: local
go-modules:
driver: local
networks:
auth-network:
driver: bridge