-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
133 lines (127 loc) · 3.75 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
133 lines (127 loc) · 3.75 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
services:
# PostgreSQL Database
postgres:
image: postgres:17.5
container_name: minly_postgres
environment:
POSTGRES_DB: ${DB_NAME:-postgres}
POSTGRES_USER: ${DB_USERNAME:-postgres}
POSTGRES_PASSWORD: ${DB_PASSWORD:-pass1234}
PGDATA: /var/lib/postgresql/data/pgdata
ports:
- "${DB_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./database/init:/docker-entrypoint-initdb.d
networks:
- minly_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME:-postgres} -d ${DB_NAME:-postgres}"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Backend Service
backend:
build:
context: ./backend
dockerfile: Dockerfile
target: ${NODE_ENV:-development}
container_name: minly_backend
environment:
- NODE_ENV=${NODE_ENV:-development}
- DB_HOST=postgres
- DB_PORT=${DB_PORT:-5432}
- DB_NAME=${DB_NAME:-postgres}
- DB_USERNAME=${DB_USERNAME:-postgres}
- DB_PASSWORD=${DB_PASSWORD:-pass1234}
- JWT_SECRET=${JWT_SECRET}
- JWT_EXPIRATION=${JWT_EXPIRATION:-3600000000}
- JWT_TOKEN_ISSUER=${JWT_TOKEN_ISSUER}
- JWT_TOKEN_AUDIENCE=${JWT_TOKEN_AUDIENCE}
- AWS_S3_MEDIA_BUCKET_NAME=${AWS_S3_MEDIA_BUCKET_NAME}
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- AWS_REGION=${AWS_REGION:-eu-central-1}
- AWS_ENDPOINT_URL_SQS=${AWS_ENDPOINT_URL_SQS}
- AWS_ENDPOINT_URL=${AWS_ENDPOINT_URL}
- SQS_QUEUE_URL=${SQS_QUEUE_URL}
- LOG_LEVEL=${LOG_LEVEL:-verbose}
- ALLOWED_ORIGINS=${ALLOWED_ORIGINS}
- LOCALSTACK_EXTERNAL_ENDPOINT=http://localhost:4566
ports:
- "${BACKEND_PORT:-3000}:3000"
volumes:
- ./backend:/app
- /app/node_modules
- backend_uploads:/app/uploads
networks:
- minly_network
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:3000/health" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
restart: unless-stopped
# Frontend Service
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
target: ${NODE_ENV:-development}
args:
- VITE_API_URL=${VITE_API_URL:-http://localhost:3000}
- VITE_APP_NAME=${VITE_APP_NAME:-Minly}
container_name: minly_frontend
environment:
- NODE_ENV=${NODE_ENV:-development}
- VITE_API_URL=${VITE_API_URL:-http://localhost:3000}
- VITE_APP_NAME=${VITE_APP_NAME:-Minly}
ports:
- "${FRONTEND_PORT:-5173}:5173"
volumes:
- ./frontend:/app
- /app/node_modules
networks:
- minly_network
depends_on:
- backend
restart: unless-stopped
# LocalStack for AWS services (S3, SQS) - Development only
localstack:
image: localstack/localstack:latest
container_name: minly_localstack
environment:
- SERVICES=s3,sqs,lambda,iam,logs,sts # Add iam,logs,sts
- DEBUG=1
- DOCKER_HOST=unix:///var/run/docker.sock
- AWS_DEFAULT_REGION=${AWS_REGION:-eu-central-1}
- AWS_ACCESS_KEY_ID=test
- AWS_SECRET_ACCESS_KEY=test
- LAMBDA_EXECUTOR=docker
- LAMBDA_REMOTE_DOCKER=false
- LAMBDA_DOCKER_NETWORK=minly-interview_minly_network
ports:
- "4566:4566"
- "4571:4571"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- ./localstack/init:/etc/localstack/init/ready.d
networks:
- minly_network
profiles:
- development
restart: unless-stopped
privileged: true
volumes:
postgres_data:
driver: local
backend_uploads:
driver: local
networks:
minly_network:
driver: bridge