我有以下docker-compose.yml文件:
version: '3'
services:
server:
build:
context: ../../
dockerfile: ./packages/website/Dockerfile
command: node /cutting/index.js
environment:
PORT: 8000
NODE_ENV: production
restart: always
nginx:
build:
context: ./
dockerfile: ./nginx/Dockerfile
command: tail -f /dev/null
depends_on:
- server
ports:
- "8000:8000"
restart: always
Run Code Online (Sandbox Code Playgroud)
以及以下内容nginx.conf:
worker_processes 1;
user nobody nogroup;
pid /tmp/nginx.pid;
error_log /tmp/logs/nginx.error.log;
events {
worker_connections 1024;
accept_mutex off;
}
http {
include mime.types;
default_type application/octet-stream;
access_log /tmp/logs/nginx.access.log combined;
sendfile on;
server {
proxy_http_version 1.1; # this is essential for chunked …Run Code Online (Sandbox Code Playgroud)