Files
IPV6/Dockerfile
编码猿 1909ff27ae 2222
2025-09-09 09:11:29 +08:00

25 lines
542 B
Docker
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.

FROM node:18-bullseye-slim
# 安装iproute2
RUN apt-get update && \
apt-get install -y --no-install-recommends iproute2 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# 创建非root用户
RUN useradd -m appuser
USER appuser
WORKDIR /app
# 复制项目文件和依赖
COPY --chown=appuser:appuser package*.json ./
COPY --chown=appuser:appuser node_modules ./node_modules
COPY --chown=appuser:appuser . .
# 暴露应用端口host模式下实际使用宿主机端口
EXPOSE 9900
# 启动命令
CMD ["npm", "start"]