-
-
Notifications
You must be signed in to change notification settings - Fork 200
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
140 lines (126 loc) 路 4.87 KB
/
Copy pathdocker-compose.yml
File metadata and controls
140 lines (126 loc) 路 4.87 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
134
135
136
137
138
139
140
services:
# MySQL Database
mysql:
image: mysql:8.0
container_name: alexandrie-mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-rootpassword}
MYSQL_DATABASE: ${MYSQL_DATABASE:-alexandrie}
MYSQL_USER: ${MYSQL_USER:-alexandrie}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-password}
volumes:
- mysql_data:/var/lib/mysql
ports:
- "${MYSQL_EXTERNAL_PORT:-3307}:3306"
networks:
- alexandrie-network
healthcheck:
test:
[
"CMD-SHELL",
"mysql -u$${MYSQL_USER} -p$${MYSQL_PASSWORD} -e 'SELECT 1' $${MYSQL_DATABASE}",
]
timeout: 10s
retries: 5
interval: 30s
start_period: 30s
# Object Storage (RustFS, S3 compatible)
rustfs:
image: rustfs/rustfs:latest
container_name: alexandrie-rustfs
restart: unless-stopped
environment:
RUSTFS_ACCESS_KEY: ${RUSTFS_ACCESS_KEY:-alexandrie-key}
RUSTFS_SECRET_KEY: ${RUSTFS_SECRET_KEY:-alexandrie-secret}
RUSTFS_CONSOLE_ENABLE: "${RUSTFS_CONSOLE_ENABLE:-false}"
RUSTFS_LOG_LEVEL: ${RUSTFS_LOG_LEVEL:-info}
ports:
- "${RUSTFS_EXTERNAL_PORT:-9000}:9000"
volumes:
- rustfs_data:/data
- rustfs_logs:/logs
networks:
- alexandrie-network
healthcheck:
test: ["CMD-SHELL", "nc -z localhost 9000 || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
# Alexandrie Backend
backend:
image: ghcr.io/smaug6739/alexandrie-backend:latest
container_name: alexandrie-backend
environment:
# General configuration
BACKEND_PORT: 8201
GIN_MODE: release
# Security and authentication
JWT_SECRET: ${JWT_SECRET:-your-secure-jwt-secret-key-change-this-in-production}
COOKIE_DOMAIN: ${COOKIE_DOMAIN:-localhost:8200} # Common domain for cookies (e.g., yourdomain.com if you have frontend.yourdomain.com and api.yourdomain.com)
FRONTEND_URL: ${FRONTEND_URL:-http://localhost:8200} # URL where the frontend is hosted (for CORS policy and url generation in emails)
ALLOW_UNSECURE: "${ALLOW_UNSECURE:-true}" # Set to 'true' if you run without HTTPS (e.g., local dev);
# Flags
CONFIG_DISABLE_SIGNUP: "${CONFIG_DISABLE_SIGNUP:-false}" # Disable user signup if set to 'true'
CONFIG_DISABLE_NATIVE_LOGIN: "${CONFIG_DISABLE_NATIVE_LOGIN:-false}" # Disable native username/password login if set to 'true' (useful if you only want OAuth providers)
# Database Configuration
DATABASE_HOST: mysql
DATABASE_PORT: 3306
DATABASE_NAME: ${MYSQL_DATABASE:-alexandrie}
DATABASE_USER: ${MYSQL_USER:-alexandrie}
DATABASE_PASSWORD: ${MYSQL_PASSWORD:-password}
# Object storage configuration (S3 compatible like RustFS, MinIO, etc.)
# OPTIONAL: If you don't want to use the CDN feature you can leave these variables empty
MINIO_ENDPOINT: rustfs:9000
MINIO_PUBLIC_URL: ${CDN_URL:-http://localhost:${RUSTFS_EXTERNAL_PORT:-9000}}
MINIO_SECURE: "${MINIO_SECURE:-false}" # Set to 'true' if your S3 endpoint uses HTTPS
MINIO_INSECURE_TLS: "${MINIO_INSECURE_TLS:-false}" # Set to 'true' if your S3 endpoint uses self-signed certificates
MINIO_ACCESSKEY: ${RUSTFS_ACCESS_KEY:-alexandrie-key}
MINIO_SECRETKEY: ${RUSTFS_SECRET_KEY:-alexandrie-secret}
MINIO_BUCKET: ${MINIO_BUCKET:-alexandrie}
# SMTP Configuration (only for password reset emails)
# OPTIONAL: If you don't want to use email features, you can leave these variables empty
SMTP_HOST: ${SMTP_HOST:-}
SMTP_MAIL: ${SMTP_MAIL:-}
SMTP_MAIL_FROM: ${SMTP_MAIL_FROM:-}
SMTP_PASSWORD: ${SMTP_PASSWORD:-}
ports:
- "${BACKEND_EXTERNAL_PORT:-8201}:8201"
extra_hosts:
- "localhost:host-gateway"
depends_on:
mysql:
condition: service_healthy
rustfs:
condition: service_healthy
networks:
- alexandrie-network
# Alexandrie Frontend
frontend:
image: ghcr.io/smaug6739/alexandrie-frontend:latest
container_name: alexandrie-frontend
restart: unless-stopped
environment:
PORT: 8200
# Flags
NUXT_PUBLIC_CONFIG_DISABLE_SIGNUP_PAGE: "${CONFIG_DISABLE_SIGNUP:-false}" # Disable signup page if set to 'true'
NUXT_PUBLIC_CONFIG_DISABLE_LANDING_PAGE: "${CONFIG_DISABLE_LANDING:-false}" # Disable landing page
# Runtime configuration - builds with these values at startup
NUXT_PUBLIC_BASE_API: ${API_URL:-http://localhost:8201}
NUXT_PUBLIC_BASE_CDN: ${CDN_URL:-http://localhost:9000}
NUXT_PUBLIC_CDN_ENDPOINT: ${CDN_ENDPOINT:-/alexandrie/}
NUXT_PUBLIC_BASE_URL: ${FRONTEND_URL:-http://localhost:8200}
ports:
- "${FRONTEND_EXTERNAL_PORT:-8200}:8200"
depends_on:
- backend
networks:
- alexandrie-network
networks:
alexandrie-network:
driver: bridge
volumes:
mysql_data:
rustfs_data:
rustfs_logs: