save
This commit is contained in:
Binary file not shown.
@@ -38,6 +38,9 @@ RUN npm ci --only=production && npm cache clean --force
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/package.json ./
|
||||
|
||||
# Copy assets directory for email templates and logos
|
||||
COPY --from=builder /app/assets ./assets
|
||||
|
||||
# Create logs directory with proper permissions
|
||||
RUN mkdir -p logs && chmod 777 logs
|
||||
|
||||
|
||||
@@ -8,31 +8,8 @@ services:
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- PORT=3000
|
||||
- DB_HOST=postgres
|
||||
- DB_PORT=5432
|
||||
- DB_NAME=serpentrace
|
||||
- DB_USERNAME=postgres
|
||||
- DB_PASSWORD=${POSTGRES_PASSWORD}
|
||||
- REDIS_URL=redis://redis:6379
|
||||
- REDIS_HOST=redis
|
||||
- REDIS_PORT=6379
|
||||
- JWT_SECRET=${JWT_SECRET}
|
||||
- JWT_EXPIRATION=${JWT_EXPIRATION:-24h}
|
||||
- JWT_REFRESH_EXPIRATION=${JWT_REFRESH_EXPIRATION:-7d}
|
||||
- MINIO_ENDPOINT=minio
|
||||
- MINIO_PORT=9000
|
||||
- MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY}
|
||||
- MINIO_SECRET_KEY=${MINIO_SECRET_KEY}
|
||||
- MINIO_USE_SSL=false
|
||||
- EMAIL_HOST=${EMAIL_HOST}
|
||||
- EMAIL_PORT=${EMAIL_PORT}
|
||||
- EMAIL_SECURE=${EMAIL_SECURE}
|
||||
- EMAIL_USER=${EMAIL_USER}
|
||||
- EMAIL_PASS=${EMAIL_PASS}
|
||||
- EMAIL_FROM=${EMAIL_FROM}
|
||||
env_file:
|
||||
- .env.server
|
||||
volumes:
|
||||
- backend_logs:/app/logs
|
||||
depends_on:
|
||||
@@ -44,12 +21,7 @@ services:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- serpentrace-network
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
tty: true
|
||||
|
||||
# Frontend service using pre-built image
|
||||
frontend:
|
||||
@@ -57,8 +29,10 @@ services:
|
||||
container_name: serpentrace-frontend
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "80:80"
|
||||
- "8080:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
depends_on:
|
||||
- backend
|
||||
networks:
|
||||
@@ -79,7 +53,7 @@ services:
|
||||
environment:
|
||||
POSTGRES_DB: serpentrace
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_INITDB_ARGS: "--encoding=UTF-8"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
@@ -101,7 +75,7 @@ services:
|
||||
- "6379:6379"
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD}
|
||||
command: redis-server --appendonly yes
|
||||
networks:
|
||||
- serpentrace-network
|
||||
healthcheck:
|
||||
@@ -119,8 +93,8 @@ services:
|
||||
- "9000:9000"
|
||||
- "9001:9001"
|
||||
environment:
|
||||
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY}
|
||||
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY}
|
||||
MINIO_ROOT_USER: serpentrace
|
||||
MINIO_ROOT_PASSWORD: serpentrace123!
|
||||
volumes:
|
||||
- minio_data:/data
|
||||
command: server /data --console-address ":9001"
|
||||
@@ -132,45 +106,32 @@ services:
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
# Adminer Database Viewer
|
||||
adminer:
|
||||
image: adminer:latest
|
||||
container_name: serpentrace-adminer
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8083:8080" # Access via http://<server-ip>:8083
|
||||
depends_on:
|
||||
- postgres
|
||||
networks:
|
||||
- serpentrace-network
|
||||
|
||||
# Redis Commander for internal administration
|
||||
# Redis Commander
|
||||
redis-commander:
|
||||
image: rediscommander/redis-commander:latest
|
||||
container_name: serpentrace-redis-commander-dev
|
||||
container_name: serpentrace-redis-commander
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8081:8081"
|
||||
- "8082:8081" # Access via http://<server-ip>:8082
|
||||
environment:
|
||||
- REDIS_HOSTS=local:redis:6379
|
||||
REDIS_HOSTS: local:serpentrace-redis:6379
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
- redis
|
||||
networks:
|
||||
- serpentrace-network
|
||||
|
||||
# Database administration tool for internal administration
|
||||
pgadmin:
|
||||
image: dpage/pgadmin4:latest
|
||||
container_name: serpentrace-pgadmin
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "5050:80"
|
||||
environment:
|
||||
PGADMIN_DEFAULT_EMAIL: admin@serpentrace.dev
|
||||
PGADMIN_DEFAULT_PASSWORD: admin
|
||||
PGADMIN_CONFIG_SERVER_MODE: 'False'
|
||||
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: 'False'
|
||||
PGADMIN_CONFIG_WTF_CSRF_ENABLED: 'False'
|
||||
volumes:
|
||||
- pgadmin_data:/var/lib/pgadmin
|
||||
- ./deployment/pgadmin_servers_deployment.json:/pgadmin4/servers.json:ro
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- serpentrace-network
|
||||
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
driver: local
|
||||
@@ -180,8 +141,6 @@ volumes:
|
||||
driver: local
|
||||
backend_logs:
|
||||
driver: local
|
||||
pgadmin_data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
serpentrace-network:
|
||||
|
||||
@@ -45,10 +45,43 @@ server {
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# Static assets caching
|
||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
# Adminer Database Viewer proxy
|
||||
location /adminer/ {
|
||||
proxy_pass http://adminer:8080/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# Redis Commander proxy
|
||||
location /redis/ {
|
||||
proxy_pass http://redis-commander:8081/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_redirect http://redis-commander:8081/ /redis/;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
}
|
||||
|
||||
# MinIO Console proxy
|
||||
location /minio/ {
|
||||
proxy_pass http://minio:9001/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_redirect http://minio:9001/ /minio/;
|
||||
sub_filter '<base href="/"' '<base href="/minio/"';
|
||||
sub_filter_types text/html;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
}
|
||||
|
||||
# Health check endpoint
|
||||
|
||||
Reference in New Issue
Block a user