Dockerfile 796 B

12345678910111213141516171819
  1. # ARG BUILD_FROM
  2. # FROM $BUILD_FROM
  3. FROM node:14-bullseye-slim
  4. ENV CK_API_ENV=prod
  5. RUN mkdir -p /etc/apt
  6. RUN touch /etc/apt/sources.list
  7. RUN sed -i "s/archive.ubuntu./mirrors.aliyun./g" /etc/apt/sources.list
  8. RUN sed -i "s/deb.debian.org/mirrors.aliyun.com/g" /etc/apt/sources.list
  9. RUN sed -i "s/security.debian.org\/debian-security/mirrors.aliyun.com\/debian-security/g" /etc/apt/sources.list
  10. RUN sed -i "s/httpredir.debian.org\/debian-security/mirrors.aliyun.com\/debian-security/g" /etc/apt/sources.list
  11. RUN apt-get update && apt-get install -y python build-essential
  12. RUN mkdir -p /workspace/node_modules
  13. COPY ["./dist", "./package.json", "/workspace/"]
  14. WORKDIR /workspace
  15. RUN npm install --production --save-exact
  16. COPY ["./node_modules", "/workspace/node_modules/"]
  17. EXPOSE 3000
  18. CMD npm start