@seip/blue-bird 0.7.5 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env_example +34 -36
- package/AGENTS.md +174 -241
- package/LICENSE +21 -21
- package/README.md +312 -343
- package/{index.js → backend/index.js} +22 -30
- package/backend/routes/api.js +57 -57
- package/core/app.js +338 -402
- package/core/auth.js +262 -256
- package/core/cache.js +174 -174
- package/core/cli/docker.js +488 -370
- package/core/cli/init.js +332 -238
- package/core/cli/route.js +42 -42
- package/core/config.js +52 -52
- package/core/database.js +263 -182
- package/core/debug.js +248 -248
- package/core/logger.js +115 -115
- package/core/middleware.js +27 -27
- package/core/router.js +144 -144
- package/core/swagger.js +40 -40
- package/core/upload.js +77 -77
- package/core/validate.js +380 -380
- package/docker/Dockerfile +16 -16
- package/docker/docker-compose.dev.yml +6 -0
- package/docker/docker-compose.mysql.yml +92 -0
- package/docker/docker-compose.none.yml +68 -0
- package/docker/docker-compose.postgres.yml +93 -0
- package/docker/nginx.conf +98 -106
- package/docker-compose.yml +92 -93
- package/frontend/about.html +98 -0
- package/frontend/css/app.css +0 -0
- package/frontend/favicon.ico +0 -0
- package/frontend/index.html +141 -0
- package/frontend/js/bundle.js +8 -0
- package/package.json +64 -72
- package/backend/logs/2026-07-14/info.log +0 -48
- package/frontend/astro.config.mjs +0 -35
- package/frontend/public/css/app.css +0 -319
- package/frontend/public/favicon.ico +0 -0
- package/frontend/src/http/api.js +0 -29
- package/frontend/src/layouts/Layout.astro +0 -20
- package/frontend/src/pages/about.astro +0 -54
- package/frontend/src/pages/index.astro +0 -110
package/docker/Dockerfile
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
FROM node:24.7.0-alpine3.21
|
|
2
|
-
|
|
3
|
-
ENV NODE_ENV=production
|
|
4
|
-
|
|
5
|
-
WORKDIR /app
|
|
6
|
-
|
|
7
|
-
COPY package*.json ./
|
|
8
|
-
|
|
9
|
-
RUN npm ci --omit=dev && npm install -g pm2
|
|
10
|
-
|
|
11
|
-
COPY . .
|
|
12
|
-
|
|
13
|
-
EXPOSE 3000
|
|
14
|
-
|
|
15
|
-
CMD ["sh", "-c", "pm2-runtime start index.js -i ${PM2_INSTANCES:-1}"]
|
|
16
|
-
|
|
1
|
+
FROM node:24.7.0-alpine3.21
|
|
2
|
+
|
|
3
|
+
ENV NODE_ENV=production
|
|
4
|
+
|
|
5
|
+
WORKDIR /app
|
|
6
|
+
|
|
7
|
+
COPY package*.json ./
|
|
8
|
+
|
|
9
|
+
RUN npm ci --omit=dev && npm install -g pm2
|
|
10
|
+
|
|
11
|
+
COPY . .
|
|
12
|
+
|
|
13
|
+
EXPOSE 3000
|
|
14
|
+
|
|
15
|
+
CMD ["sh", "-c", "pm2-runtime start index.js -i ${PM2_INSTANCES:-1}"]
|
|
16
|
+
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
services:
|
|
2
|
+
app:
|
|
3
|
+
build:
|
|
4
|
+
context: .
|
|
5
|
+
dockerfile: docker/Dockerfile
|
|
6
|
+
container_name: ${TITLE:-bluebird}-app
|
|
7
|
+
restart: unless-stopped
|
|
8
|
+
expose:
|
|
9
|
+
- "3000"
|
|
10
|
+
volumes:
|
|
11
|
+
- .:/app
|
|
12
|
+
- /app/node_modules
|
|
13
|
+
env_file:
|
|
14
|
+
- .env
|
|
15
|
+
environment:
|
|
16
|
+
- NODE_ENV=production
|
|
17
|
+
- DEBUG=false
|
|
18
|
+
- DATABASE_URL=mysql://${DB_USER:-root}:${DB_PASSWORD:-root}@mysql:${DB_PORT:-3306}/${DB_NAME:-blue_bird}
|
|
19
|
+
- REDIS_HOST=redis
|
|
20
|
+
- REDIS_PORT=6379
|
|
21
|
+
- PORT=3000
|
|
22
|
+
depends_on:
|
|
23
|
+
mysql:
|
|
24
|
+
condition: service_healthy
|
|
25
|
+
redis:
|
|
26
|
+
condition: service_healthy
|
|
27
|
+
networks:
|
|
28
|
+
- bluebird_net
|
|
29
|
+
profiles:
|
|
30
|
+
- prod
|
|
31
|
+
|
|
32
|
+
nginx:
|
|
33
|
+
image: nginx:1.27-alpine
|
|
34
|
+
container_name: ${TITLE:-bluebird}-nginx
|
|
35
|
+
restart: unless-stopped
|
|
36
|
+
ports:
|
|
37
|
+
- "${PORT:-3000}:80"
|
|
38
|
+
volumes:
|
|
39
|
+
- .:/app:ro
|
|
40
|
+
- ./docker/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
41
|
+
depends_on:
|
|
42
|
+
app:
|
|
43
|
+
condition: service_started
|
|
44
|
+
networks:
|
|
45
|
+
- bluebird_net
|
|
46
|
+
profiles:
|
|
47
|
+
- prod
|
|
48
|
+
|
|
49
|
+
mysql:
|
|
50
|
+
image: mysql:8.0
|
|
51
|
+
container_name: ${TITLE:-bluebird}-mysql
|
|
52
|
+
restart: unless-stopped
|
|
53
|
+
environment:
|
|
54
|
+
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:-root}
|
|
55
|
+
MYSQL_DATABASE: ${DB_NAME:-blue_bird}
|
|
56
|
+
ports:
|
|
57
|
+
- "${DB_PORT:-3306}:3306"
|
|
58
|
+
volumes:
|
|
59
|
+
- mysql_data:/var/lib/mysql
|
|
60
|
+
healthcheck:
|
|
61
|
+
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${DB_PASSWORD:-root}"]
|
|
62
|
+
interval: 10s
|
|
63
|
+
timeout: 5s
|
|
64
|
+
retries: 5
|
|
65
|
+
start_period: 30s
|
|
66
|
+
networks:
|
|
67
|
+
- bluebird_net
|
|
68
|
+
|
|
69
|
+
redis:
|
|
70
|
+
image: redis:7-alpine
|
|
71
|
+
container_name: ${TITLE:-bluebird}-redis
|
|
72
|
+
restart: unless-stopped
|
|
73
|
+
ports:
|
|
74
|
+
- "${REDIS_PORT:-6379}:6379"
|
|
75
|
+
volumes:
|
|
76
|
+
- redis_data:/data
|
|
77
|
+
networks:
|
|
78
|
+
- bluebird_net
|
|
79
|
+
healthcheck:
|
|
80
|
+
test: ["CMD", "redis-cli", "ping"]
|
|
81
|
+
interval: 5s
|
|
82
|
+
timeout: 3s
|
|
83
|
+
retries: 5
|
|
84
|
+
|
|
85
|
+
volumes:
|
|
86
|
+
mysql_data:
|
|
87
|
+
redis_data:
|
|
88
|
+
|
|
89
|
+
networks:
|
|
90
|
+
bluebird_net:
|
|
91
|
+
name: ${TITLE:-bluebird}_network
|
|
92
|
+
driver: bridge
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
services:
|
|
2
|
+
app:
|
|
3
|
+
build:
|
|
4
|
+
context: .
|
|
5
|
+
dockerfile: docker/Dockerfile
|
|
6
|
+
container_name: ${TITLE:-bluebird}-app
|
|
7
|
+
restart: unless-stopped
|
|
8
|
+
expose:
|
|
9
|
+
- "3000"
|
|
10
|
+
volumes:
|
|
11
|
+
- .:/app
|
|
12
|
+
- /app/node_modules
|
|
13
|
+
env_file:
|
|
14
|
+
- .env
|
|
15
|
+
environment:
|
|
16
|
+
- NODE_ENV=production
|
|
17
|
+
- DEBUG=false
|
|
18
|
+
- REDIS_HOST=redis
|
|
19
|
+
- REDIS_PORT=6379
|
|
20
|
+
- PORT=3000
|
|
21
|
+
depends_on:
|
|
22
|
+
redis:
|
|
23
|
+
condition: service_healthy
|
|
24
|
+
networks:
|
|
25
|
+
- bluebird_net
|
|
26
|
+
profiles:
|
|
27
|
+
- prod
|
|
28
|
+
|
|
29
|
+
nginx:
|
|
30
|
+
image: nginx:1.27-alpine
|
|
31
|
+
container_name: ${TITLE:-bluebird}-nginx
|
|
32
|
+
restart: unless-stopped
|
|
33
|
+
ports:
|
|
34
|
+
- "${PORT:-3000}:80"
|
|
35
|
+
volumes:
|
|
36
|
+
- .:/app:ro
|
|
37
|
+
- ./docker/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
38
|
+
depends_on:
|
|
39
|
+
app:
|
|
40
|
+
condition: service_started
|
|
41
|
+
networks:
|
|
42
|
+
- bluebird_net
|
|
43
|
+
profiles:
|
|
44
|
+
- prod
|
|
45
|
+
|
|
46
|
+
redis:
|
|
47
|
+
image: redis:7-alpine
|
|
48
|
+
container_name: ${TITLE:-bluebird}-redis
|
|
49
|
+
restart: unless-stopped
|
|
50
|
+
ports:
|
|
51
|
+
- "${REDIS_PORT:-6379}:6379"
|
|
52
|
+
volumes:
|
|
53
|
+
- redis_data:/data
|
|
54
|
+
networks:
|
|
55
|
+
- bluebird_net
|
|
56
|
+
healthcheck:
|
|
57
|
+
test: ["CMD", "redis-cli", "ping"]
|
|
58
|
+
interval: 5s
|
|
59
|
+
timeout: 3s
|
|
60
|
+
retries: 5
|
|
61
|
+
|
|
62
|
+
volumes:
|
|
63
|
+
redis_data:
|
|
64
|
+
|
|
65
|
+
networks:
|
|
66
|
+
bluebird_net:
|
|
67
|
+
name: ${TITLE:-bluebird}_network
|
|
68
|
+
driver: bridge
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
services:
|
|
2
|
+
app:
|
|
3
|
+
build:
|
|
4
|
+
context: .
|
|
5
|
+
dockerfile: docker/Dockerfile
|
|
6
|
+
container_name: ${TITLE:-bluebird}-app
|
|
7
|
+
restart: unless-stopped
|
|
8
|
+
expose:
|
|
9
|
+
- "3000"
|
|
10
|
+
volumes:
|
|
11
|
+
- .:/app
|
|
12
|
+
- /app/node_modules
|
|
13
|
+
env_file:
|
|
14
|
+
- .env
|
|
15
|
+
environment:
|
|
16
|
+
- NODE_ENV=production
|
|
17
|
+
- DEBUG=false
|
|
18
|
+
- DATABASE_URL=postgresql://${DB_USER:-postgres}:${DB_PASSWORD:-root}@postgres:${DB_PORT:-5432}/${DB_NAME:-blue_bird}?schema=public
|
|
19
|
+
- REDIS_HOST=redis
|
|
20
|
+
- REDIS_PORT=6379
|
|
21
|
+
- PORT=3000
|
|
22
|
+
depends_on:
|
|
23
|
+
postgres:
|
|
24
|
+
condition: service_healthy
|
|
25
|
+
redis:
|
|
26
|
+
condition: service_healthy
|
|
27
|
+
networks:
|
|
28
|
+
- bluebird_net
|
|
29
|
+
profiles:
|
|
30
|
+
- prod
|
|
31
|
+
|
|
32
|
+
nginx:
|
|
33
|
+
image: nginx:1.27-alpine
|
|
34
|
+
container_name: ${TITLE:-bluebird}-nginx
|
|
35
|
+
restart: unless-stopped
|
|
36
|
+
ports:
|
|
37
|
+
- "${PORT:-3000}:80"
|
|
38
|
+
volumes:
|
|
39
|
+
- .:/app:ro
|
|
40
|
+
- ./docker/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
41
|
+
depends_on:
|
|
42
|
+
app:
|
|
43
|
+
condition: service_started
|
|
44
|
+
networks:
|
|
45
|
+
- bluebird_net
|
|
46
|
+
profiles:
|
|
47
|
+
- prod
|
|
48
|
+
|
|
49
|
+
postgres:
|
|
50
|
+
image: postgres:18-alpine
|
|
51
|
+
container_name: ${TITLE:-bluebird}-postgres
|
|
52
|
+
restart: unless-stopped
|
|
53
|
+
environment:
|
|
54
|
+
POSTGRES_USER: ${DB_USER:-postgres}
|
|
55
|
+
POSTGRES_PASSWORD: ${DB_PASSWORD:-root}
|
|
56
|
+
POSTGRES_DB: ${DB_NAME:-blue_bird}
|
|
57
|
+
ports:
|
|
58
|
+
- "${DB_PORT:-5432}:5432"
|
|
59
|
+
volumes:
|
|
60
|
+
- postgres_data:/var/lib/postgresql
|
|
61
|
+
healthcheck:
|
|
62
|
+
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-postgres} -d ${DB_NAME:-blue_bird}"]
|
|
63
|
+
interval: 10s
|
|
64
|
+
timeout: 5s
|
|
65
|
+
retries: 5
|
|
66
|
+
start_period: 30s
|
|
67
|
+
networks:
|
|
68
|
+
- bluebird_net
|
|
69
|
+
|
|
70
|
+
redis:
|
|
71
|
+
image: redis:7-alpine
|
|
72
|
+
container_name: ${TITLE:-bluebird}-redis
|
|
73
|
+
restart: unless-stopped
|
|
74
|
+
ports:
|
|
75
|
+
- "${REDIS_PORT:-6379}:6379"
|
|
76
|
+
volumes:
|
|
77
|
+
- redis_data:/data
|
|
78
|
+
networks:
|
|
79
|
+
- bluebird_net
|
|
80
|
+
healthcheck:
|
|
81
|
+
test: ["CMD", "redis-cli", "ping"]
|
|
82
|
+
interval: 5s
|
|
83
|
+
timeout: 3s
|
|
84
|
+
retries: 5
|
|
85
|
+
|
|
86
|
+
volumes:
|
|
87
|
+
postgres_data:
|
|
88
|
+
redis_data:
|
|
89
|
+
|
|
90
|
+
networks:
|
|
91
|
+
bluebird_net:
|
|
92
|
+
name: ${TITLE:-bluebird}_network
|
|
93
|
+
driver: bridge
|
package/docker/nginx.conf
CHANGED
|
@@ -1,106 +1,98 @@
|
|
|
1
|
-
user nginx;
|
|
2
|
-
worker_processes auto;
|
|
3
|
-
|
|
4
|
-
error_log /var/log/nginx/error.log notice;
|
|
5
|
-
pid /var/run/nginx.pid;
|
|
6
|
-
|
|
7
|
-
events {
|
|
8
|
-
worker_connections 1024;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
http {
|
|
12
|
-
include /etc/nginx/mime.types;
|
|
13
|
-
default_type application/octet-stream;
|
|
14
|
-
|
|
15
|
-
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
16
|
-
'$status $body_bytes_sent "$http_referer" '
|
|
17
|
-
'"$http_user_agent" "$http_x_forwarded_for"';
|
|
18
|
-
|
|
19
|
-
access_log /var/log/nginx/access.log main;
|
|
20
|
-
|
|
21
|
-
sendfile on;
|
|
22
|
-
tcp_nopush on;
|
|
23
|
-
tcp_nodelay on;
|
|
24
|
-
keepalive_timeout 65;
|
|
25
|
-
types_hash_max_size 2048;
|
|
26
|
-
|
|
27
|
-
gzip on;
|
|
28
|
-
gzip_disable "msie6";
|
|
29
|
-
gzip_vary on;
|
|
30
|
-
gzip_proxied any;
|
|
31
|
-
gzip_comp_level 6;
|
|
32
|
-
gzip_buffers 16 8k;
|
|
33
|
-
gzip_http_version 1.1;
|
|
34
|
-
gzip_min_length 256;
|
|
35
|
-
gzip_types
|
|
36
|
-
text/plain
|
|
37
|
-
text/css
|
|
38
|
-
application/json
|
|
39
|
-
application/javascript
|
|
40
|
-
application/x-javascript
|
|
41
|
-
text/xml
|
|
42
|
-
application/xml
|
|
43
|
-
application/xml+rss
|
|
44
|
-
text/javascript
|
|
45
|
-
image/svg+xml;
|
|
46
|
-
|
|
47
|
-
limit_req_zone $binary_remote_addr zone=bluebird_limit:10m rate=10r/s;
|
|
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
|
-
proxy_set_header
|
|
92
|
-
proxy_set_header
|
|
93
|
-
proxy_set_header X-
|
|
94
|
-
proxy_set_header X-Forwarded-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
|
|
100
|
-
proxy_cache_lock on;
|
|
101
|
-
proxy_cache_bypass $cookie_auth $http_authorization;
|
|
102
|
-
proxy_no_cache $cookie_auth $http_authorization;
|
|
103
|
-
add_header X-Cache-Status $upstream_cache_status;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
1
|
+
user nginx;
|
|
2
|
+
worker_processes auto;
|
|
3
|
+
|
|
4
|
+
error_log /var/log/nginx/error.log notice;
|
|
5
|
+
pid /var/run/nginx.pid;
|
|
6
|
+
|
|
7
|
+
events {
|
|
8
|
+
worker_connections 1024;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
http {
|
|
12
|
+
include /etc/nginx/mime.types;
|
|
13
|
+
default_type application/octet-stream;
|
|
14
|
+
|
|
15
|
+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
16
|
+
'$status $body_bytes_sent "$http_referer" '
|
|
17
|
+
'"$http_user_agent" "$http_x_forwarded_for"';
|
|
18
|
+
|
|
19
|
+
access_log /var/log/nginx/access.log main;
|
|
20
|
+
|
|
21
|
+
sendfile on;
|
|
22
|
+
tcp_nopush on;
|
|
23
|
+
tcp_nodelay on;
|
|
24
|
+
keepalive_timeout 65;
|
|
25
|
+
types_hash_max_size 2048;
|
|
26
|
+
|
|
27
|
+
gzip on;
|
|
28
|
+
gzip_disable "msie6";
|
|
29
|
+
gzip_vary on;
|
|
30
|
+
gzip_proxied any;
|
|
31
|
+
gzip_comp_level 6;
|
|
32
|
+
gzip_buffers 16 8k;
|
|
33
|
+
gzip_http_version 1.1;
|
|
34
|
+
gzip_min_length 256;
|
|
35
|
+
gzip_types
|
|
36
|
+
text/plain
|
|
37
|
+
text/css
|
|
38
|
+
application/json
|
|
39
|
+
application/javascript
|
|
40
|
+
application/x-javascript
|
|
41
|
+
text/xml
|
|
42
|
+
application/xml
|
|
43
|
+
application/xml+rss
|
|
44
|
+
text/javascript
|
|
45
|
+
image/svg+xml;
|
|
46
|
+
|
|
47
|
+
limit_req_zone $binary_remote_addr zone=bluebird_limit:10m rate=10r/s;
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
server {
|
|
51
|
+
listen 80;
|
|
52
|
+
server_name localhost;
|
|
53
|
+
root /app/frontend;
|
|
54
|
+
|
|
55
|
+
resolver 127.0.0.11 valid=5s;
|
|
56
|
+
|
|
57
|
+
location ~* /(\.env|\.git|wp-content|wp-admin|xmlrpc\.php) {
|
|
58
|
+
return 444;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
location ~* \.(?:css|js|jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
|
|
62
|
+
expires 1M;
|
|
63
|
+
access_log off;
|
|
64
|
+
add_header Cache-Control "public";
|
|
65
|
+
try_files $uri =404;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
location / {
|
|
69
|
+
try_files $uri $uri.html $uri/ @node_app;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
location /api/ {
|
|
73
|
+
limit_req zone=bluebird_limit burst=20 nodelay;
|
|
74
|
+
set $upstream_target http://app:3000;
|
|
75
|
+
proxy_pass $upstream_target;
|
|
76
|
+
proxy_http_version 1.1;
|
|
77
|
+
proxy_set_header Connection "";
|
|
78
|
+
proxy_set_header Host $host;
|
|
79
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
80
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
81
|
+
proxy_set_header X-Forwarded-Proto $scheme;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
location @node_app {
|
|
86
|
+
limit_req zone=bluebird_limit burst=20 nodelay;
|
|
87
|
+
|
|
88
|
+
set $upstream_target http://app:3000;
|
|
89
|
+
proxy_pass $upstream_target;
|
|
90
|
+
proxy_http_version 1.1;
|
|
91
|
+
proxy_set_header Connection "";
|
|
92
|
+
proxy_set_header Host $host;
|
|
93
|
+
proxy_set_header X-Real-IP $remote_addr;
|
|
94
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
95
|
+
proxy_set_header X-Forwarded-Proto $scheme;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
package/docker-compose.yml
CHANGED
|
@@ -1,93 +1,92 @@
|
|
|
1
|
-
services:
|
|
2
|
-
app:
|
|
3
|
-
build:
|
|
4
|
-
context: .
|
|
5
|
-
dockerfile: docker/Dockerfile
|
|
6
|
-
container_name: ${TITLE:-bluebird}-app
|
|
7
|
-
restart: unless-stopped
|
|
8
|
-
expose:
|
|
9
|
-
- "3000"
|
|
10
|
-
volumes:
|
|
11
|
-
- .:/app
|
|
12
|
-
- /app/node_modules
|
|
13
|
-
env_file:
|
|
14
|
-
- .env
|
|
15
|
-
environment:
|
|
16
|
-
- NODE_ENV=production
|
|
17
|
-
- DEBUG=false
|
|
18
|
-
- DATABASE_URL=mysql
|
|
19
|
-
- REDIS_HOST=redis
|
|
20
|
-
- REDIS_PORT=6379
|
|
21
|
-
- PORT=3000
|
|
22
|
-
depends_on:
|
|
23
|
-
mysql:
|
|
24
|
-
condition: service_healthy
|
|
25
|
-
redis:
|
|
26
|
-
condition: service_healthy
|
|
27
|
-
networks:
|
|
28
|
-
- bluebird_net
|
|
29
|
-
profiles:
|
|
30
|
-
- prod
|
|
31
|
-
|
|
32
|
-
nginx:
|
|
33
|
-
image: nginx:1.27-alpine
|
|
34
|
-
container_name: ${TITLE:-bluebird}-nginx
|
|
35
|
-
restart: unless-stopped
|
|
36
|
-
ports:
|
|
37
|
-
- "${PORT:-3000}:80"
|
|
38
|
-
volumes:
|
|
39
|
-
- .:/app:ro
|
|
40
|
-
- ./docker/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
41
|
-
depends_on:
|
|
42
|
-
app:
|
|
43
|
-
condition: service_started
|
|
44
|
-
networks:
|
|
45
|
-
- bluebird_net
|
|
46
|
-
profiles:
|
|
47
|
-
- prod
|
|
48
|
-
|
|
49
|
-
mysql:
|
|
50
|
-
image: mysql:8.0
|
|
51
|
-
container_name: ${TITLE:-bluebird}-mysql
|
|
52
|
-
restart: unless-stopped
|
|
53
|
-
environment:
|
|
54
|
-
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:-root}
|
|
55
|
-
MYSQL_DATABASE: ${DB_NAME:-blue_bird}
|
|
56
|
-
ports:
|
|
57
|
-
- "${DB_PORT:-3306}:3306"
|
|
58
|
-
volumes:
|
|
59
|
-
- mysql_data:/var/lib/mysql
|
|
60
|
-
healthcheck:
|
|
61
|
-
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${DB_PASSWORD:-root}"]
|
|
62
|
-
interval: 10s
|
|
63
|
-
timeout: 5s
|
|
64
|
-
retries: 5
|
|
65
|
-
start_period: 30s
|
|
66
|
-
networks:
|
|
67
|
-
- bluebird_net
|
|
68
|
-
|
|
69
|
-
redis:
|
|
70
|
-
image: redis:7-alpine
|
|
71
|
-
container_name: ${TITLE:-bluebird}-redis
|
|
72
|
-
restart: unless-stopped
|
|
73
|
-
ports:
|
|
74
|
-
- "${REDIS_PORT:-6379}:6379"
|
|
75
|
-
volumes:
|
|
76
|
-
- redis_data:/data
|
|
77
|
-
networks:
|
|
78
|
-
- bluebird_net
|
|
79
|
-
healthcheck:
|
|
80
|
-
test: ["CMD", "redis-cli", "ping"]
|
|
81
|
-
interval: 5s
|
|
82
|
-
timeout: 3s
|
|
83
|
-
retries: 5
|
|
84
|
-
|
|
85
|
-
volumes:
|
|
86
|
-
mysql_data:
|
|
87
|
-
redis_data:
|
|
88
|
-
|
|
89
|
-
networks:
|
|
90
|
-
bluebird_net:
|
|
91
|
-
name: ${TITLE:-bluebird}_network
|
|
92
|
-
driver: bridge
|
|
93
|
-
|
|
1
|
+
services:
|
|
2
|
+
app:
|
|
3
|
+
build:
|
|
4
|
+
context: .
|
|
5
|
+
dockerfile: docker/Dockerfile
|
|
6
|
+
container_name: ${TITLE:-bluebird}-app
|
|
7
|
+
restart: unless-stopped
|
|
8
|
+
expose:
|
|
9
|
+
- "3000"
|
|
10
|
+
volumes:
|
|
11
|
+
- .:/app
|
|
12
|
+
- /app/node_modules
|
|
13
|
+
env_file:
|
|
14
|
+
- .env
|
|
15
|
+
environment:
|
|
16
|
+
- NODE_ENV=production
|
|
17
|
+
- DEBUG=false
|
|
18
|
+
- DATABASE_URL=mysql://${DB_USER:-root}:${DB_PASSWORD:-root}@mysql:${DB_PORT:-3306}/${DB_NAME:-blue_bird}
|
|
19
|
+
- REDIS_HOST=redis
|
|
20
|
+
- REDIS_PORT=6379
|
|
21
|
+
- PORT=3000
|
|
22
|
+
depends_on:
|
|
23
|
+
mysql:
|
|
24
|
+
condition: service_healthy
|
|
25
|
+
redis:
|
|
26
|
+
condition: service_healthy
|
|
27
|
+
networks:
|
|
28
|
+
- bluebird_net
|
|
29
|
+
profiles:
|
|
30
|
+
- prod
|
|
31
|
+
|
|
32
|
+
nginx:
|
|
33
|
+
image: nginx:1.27-alpine
|
|
34
|
+
container_name: ${TITLE:-bluebird}-nginx
|
|
35
|
+
restart: unless-stopped
|
|
36
|
+
ports:
|
|
37
|
+
- "${PORT:-3000}:80"
|
|
38
|
+
volumes:
|
|
39
|
+
- .:/app:ro
|
|
40
|
+
- ./docker/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
41
|
+
depends_on:
|
|
42
|
+
app:
|
|
43
|
+
condition: service_started
|
|
44
|
+
networks:
|
|
45
|
+
- bluebird_net
|
|
46
|
+
profiles:
|
|
47
|
+
- prod
|
|
48
|
+
|
|
49
|
+
mysql:
|
|
50
|
+
image: mysql:8.0
|
|
51
|
+
container_name: ${TITLE:-bluebird}-mysql
|
|
52
|
+
restart: unless-stopped
|
|
53
|
+
environment:
|
|
54
|
+
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD:-root}
|
|
55
|
+
MYSQL_DATABASE: ${DB_NAME:-blue_bird}
|
|
56
|
+
ports:
|
|
57
|
+
- "${DB_PORT:-3306}:3306"
|
|
58
|
+
volumes:
|
|
59
|
+
- mysql_data:/var/lib/mysql
|
|
60
|
+
healthcheck:
|
|
61
|
+
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${DB_PASSWORD:-root}"]
|
|
62
|
+
interval: 10s
|
|
63
|
+
timeout: 5s
|
|
64
|
+
retries: 5
|
|
65
|
+
start_period: 30s
|
|
66
|
+
networks:
|
|
67
|
+
- bluebird_net
|
|
68
|
+
|
|
69
|
+
redis:
|
|
70
|
+
image: redis:7-alpine
|
|
71
|
+
container_name: ${TITLE:-bluebird}-redis
|
|
72
|
+
restart: unless-stopped
|
|
73
|
+
ports:
|
|
74
|
+
- "${REDIS_PORT:-6379}:6379"
|
|
75
|
+
volumes:
|
|
76
|
+
- redis_data:/data
|
|
77
|
+
networks:
|
|
78
|
+
- bluebird_net
|
|
79
|
+
healthcheck:
|
|
80
|
+
test: ["CMD", "redis-cli", "ping"]
|
|
81
|
+
interval: 5s
|
|
82
|
+
timeout: 3s
|
|
83
|
+
retries: 5
|
|
84
|
+
|
|
85
|
+
volumes:
|
|
86
|
+
mysql_data:
|
|
87
|
+
redis_data:
|
|
88
|
+
|
|
89
|
+
networks:
|
|
90
|
+
bluebird_net:
|
|
91
|
+
name: ${TITLE:-bluebird}_network
|
|
92
|
+
driver: bridge
|