File tree Expand file tree Collapse file tree 7 files changed +124
-7
lines changed
Expand file tree Collapse file tree 7 files changed +124
-7
lines changed Original file line number Diff line number Diff line change 1-
21node_modules
32.git
4- .env
5- dist
3+ .env
Original file line number Diff line number Diff line change 11PORT = 8080
2- ALLOWED_ORIGINS = " http://localhost:3000,https://myapp.com"
2+ ALLOWED_ORIGINS = " http://localhost,http://localhost :3000,https://myapp.com"
33NODE_ENV = " development"
44
55# 토큰 단방향 암호화 전용 핵심 키
Original file line number Diff line number Diff line change 2222Thumbs.db
2323
2424# 로그 파일
25- logs /
25+ logs /*
2626* .log
2727* .gz
2828* .out
Original file line number Diff line number Diff line change @@ -35,6 +35,6 @@ RUN pnpm install --prod --frozen-lockfile
3535COPY --from=builder /usr/src/app/dist ./dist
3636COPY ecosystem.config.js .
3737
38- EXPOSE 3000
38+ EXPOSE 8080
3939
4040CMD ["pm2-runtime" , "start" , "ecosystem.config.js" ]
Original file line number Diff line number Diff line change 11# docker-compose.yml
2+ name : velog-dashboard-v2-app
23version : ' 3.9'
34
45services :
5- app :
6+ api :
67 build :
78 context : .
89 dockerfile : Dockerfile
10+ image : velog-dashboard-v2-api
11+ hostname : velog-dashboard-v2-api
912 container_name : velog-dashboard-v2-api
1013 ports :
1114 - " 8080:8080"
15+ volumes :
16+ - ./logs/api:/usr/src/app/logs
1217 env_file :
1318 - .env
1419 environment :
1520 NODE_ENV : production
21+ TZ : Asia/Seoul
1622 restart : unless-stopped
23+
24+ fe :
25+ image : nuung/velog-dashboard-v2-fe:latest
26+ hostname : velog-dashboard-v2-fe
27+ container_name : velog-dashboard-v2-fe
28+ ports :
29+ - " 3000:3000"
30+ volumes :
31+ - ./logs/fe:/usr/src/app/logs
32+ environment :
33+ NODE_ENV : production
34+ TZ : Asia/Seoul
35+ restart : unless-stopped
36+ depends_on :
37+ - api
38+
39+ nginx :
40+ image : nginx:alpine
41+ hostname : velog-dashboard-v2-nginx
42+ container_name : velog-dashboard-v2-nginx
43+ ports :
44+ - " 80:80"
45+ - " 443:443"
46+ volumes :
47+ - ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf
48+ - ./nginx/conf.d:/etc/nginx/conf.d
49+ - ./logs/nginx:/var/log/nginx
50+ environment :
51+ TZ : Asia/Seoul
52+ restart : unless-stopped
53+ depends_on :
54+ - api
55+ - fe
Original file line number Diff line number Diff line change 1+ server {
2+ listen 80;
3+ server_name velog-dashboard-v2;
4+
5+ # fe
6+ location ^~ / {
7+ proxy_set_header Host $host;
8+ proxy_set_header X-Real-IP $remote_addr;
9+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
10+ proxy_set_header X-Forwarded-Proto $scheme;
11+ proxy_pass http://fe:3000;
12+ }
13+
14+ # api
15+ location ^~ /api/ {
16+ proxy_set_header Host $host;
17+ proxy_set_header X-Real-IP $remote_addr;
18+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
19+ proxy_set_header X-Forwarded-Proto $scheme;
20+ proxy_pass http://api:8080;
21+ }
22+
23+ # 404, 500 error 핸들링
24+ error_page 404 /404.html;
25+ location = /404.html {
26+ root /usr/share/nginx/error;
27+ }
28+
29+ error_page 500 502 503 504 /500.html;
30+ location = /500.html {
31+ root /usr/share/nginx/error;
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ user nginx;
2+ worker_processes 1;
3+
4+ pid /var/run/nginx.pid ;
5+
6+ events {
7+ worker_connections 1024 ;
8+ }
9+
10+ http {
11+ include /etc/nginx/mime.types ;
12+ default_type application/octet-stream ;
13+
14+ log_format main '{"@time":"$time_iso8601",'
15+ '"IP":"$remote_addr",'
16+ '"Status":$status,'
17+ '"Method":"$request_method",'
18+ '"RequestTime":$request_time,'
19+ '"URI":"$request_uri",'
20+ '"QueryString":"$query_string",'
21+ '"SentSize":$bytes_sent,'
22+ '"UA":"$http_user_agent",'
23+ '"Session":"$http_authorization",'
24+ '"Referer":"$http_referer"}' ;
25+
26+ # charset koi8-r;
27+ access_log /var/log/nginx/access.log main;
28+ error_log /var/log/nginx/error.log warn;
29+
30+ # client send request size
31+ client_max_body_size 3G ;
32+
33+ set_real_ip_from 127.0.0.1 ;
34+ real_ip_header X-Forwarded-For;
35+
36+ sendfile on;
37+ #tcp_nopush on;
38+
39+ keepalive_timeout 65 ;
40+
41+ #gzip on;
42+
43+ include /etc/nginx/conf.d/*.conf;
44+
45+ #security
46+ server_tokens off;
47+ }
You can’t perform that action at this time.
0 commit comments