Files
website/nodejs-project/naga/docker-compose.yml
2026-01-18 20:39:34 +08:00

28 lines
568 B
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
version: '3.8'
services:
app:
image: node:18
container_name: data-collection-app
working_dir: /app
volumes:
# 挂载当前目录到容器的 /app 目录
- .:/app
# 使用命名卷存储 node_modules避免权限问题
- node_modules:/app/node_modules
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- PORT=3000
command: sh -c "npm install && npm start"
restart: unless-stopped
networks:
- app-network
volumes:
node_modules:
networks:
app-network:
driver: bridge