Feat: change network
This commit is contained in:
parent
d106ff79f2
commit
adcd663c38
@ -19,8 +19,8 @@ services:
|
|||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
volumes:
|
volumes:
|
||||||
- $PWD/init.sql:/docker-entrypoint-initdb.d/init.sql
|
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
|
||||||
- $PWD/mysql:/var/lib/mysql
|
- ./mysql:/var/lib/mysql
|
||||||
ports:
|
ports:
|
||||||
- $MYSQLDB_LOCAL_PORT:$MYSQLDB_DOCKER_PORT
|
- $MYSQLDB_LOCAL_PORT:$MYSQLDB_DOCKER_PORT
|
||||||
networks:
|
networks:
|
||||||
@ -45,11 +45,15 @@ services:
|
|||||||
command: bash -c "npm run dev"
|
command: bash -c "npm run dev"
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
image: nginx:alpine
|
image: nginx
|
||||||
ports:
|
ports:
|
||||||
- 8000:80
|
- 80:80
|
||||||
|
links:
|
||||||
|
- node-app:node-app
|
||||||
volumes:
|
volumes:
|
||||||
|
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
|
||||||
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
|
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
|
||||||
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- backend
|
- backend
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@ -1,12 +1,18 @@
|
|||||||
server {
|
server {
|
||||||
client_max_body_size 25M;
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name 127.0.0.1;
|
||||||
|
|
||||||
|
# Logging
|
||||||
|
access_log /var/log/nginx/access.log;
|
||||||
|
error_log /var/log/nginx/error.log;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://127.0.0.1:3000;
|
proxy_pass http://node-app:3000;
|
||||||
proxy_http_version 1.1;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection 'upgrade';
|
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_cache_bypass $http_upgrade;
|
proxy_redirect off;
|
||||||
|
# max uploadable file size
|
||||||
|
client_max_body_size 4G;
|
||||||
}
|
}
|
||||||
}
|
}
|
39
nginx/nginx.conf
Normal file
39
nginx/nginx.conf
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
user nginx;
|
||||||
|
worker_processes auto;
|
||||||
|
|
||||||
|
error_log /var/log/nginx/error.log warn;
|
||||||
|
pid /var/run/nginx.pid;
|
||||||
|
|
||||||
|
events {
|
||||||
|
use epoll;
|
||||||
|
worker_connections 1024;
|
||||||
|
multi_accept on;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
limit_req_zone $binary_remote_addr zone=byip:10m rate=3r/s;
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
|
||||||
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||||
|
'$status $body_bytes_sent "$http_referer" '
|
||||||
|
'"$http_user_agent" "$http_x_forwarded_for" '
|
||||||
|
'$request_time $upstream_response_time';
|
||||||
|
|
||||||
|
access_log /var/log/nginx/access.log main;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
tcp_nopush on;
|
||||||
|
tcp_nodelay on;
|
||||||
|
keepalive_timeout 65;
|
||||||
|
types_hash_max_size 2048;
|
||||||
|
server_tokens off;
|
||||||
|
|
||||||
|
#gzip on;
|
||||||
|
|
||||||
|
##
|
||||||
|
# Virtual Host Configs
|
||||||
|
##
|
||||||
|
include /etc/nginx/conf.d/*.conf;
|
||||||
|
include /etc/nginx/sites-enabled/*;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user