小编dag*_*da1的帖子

用于 nginx 和 nodejs 服务器的 docker-compose

我有以下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)

nginx node.js docker docker-compose

11
推荐指数
1
解决办法
1万
查看次数

标签 统计

docker ×1

docker-compose ×1

nginx ×1

node.js ×1