parent
2021081587
commit
6f561a6981
3 changed files with 26 additions and 14 deletions
@ -1,14 +1,26 @@ |
||||
# Sử dụng image Node.js chính thức phiên bản 16 |
||||
FROM node:16 |
||||
|
||||
# Set working directory |
||||
# Cập nhật hệ thống và cài các công cụ cần thiết |
||||
RUN apt-get update && apt-get install -y curl gnupg |
||||
|
||||
# Nếu bạn muốn chuyển về Node.js v14, cần thay FROM node:16 bằng image khác. |
||||
# FROM node:14 |
||||
|
||||
# Làm sạch cache của apt sau khi cài |
||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* |
||||
|
||||
# Thiết lập thư mục làm việc |
||||
WORKDIR /var/www |
||||
|
||||
# get latest nodejs |
||||
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - |
||||
RUN apt-get install -y nodejs |
||||
|
||||
# Install Yarn |
||||
#RUN npm install --global yarn |
||||
# COPY src/package*.json ./src/ |
||||
|
||||
# Cài đặt dependencies |
||||
# RUN cd src && npm install |
||||
|
||||
# Nếu bạn muốn cài Yarn, có thể bỏ comment dòng sau |
||||
# RUN npm install --global yarn |
||||
|
||||
#npm install |
||||
#RUN bash -c "cd /var/www/src; npm install" |
||||
# Nếu bạn cần chạy ứng dụng (bỏ comment nếu cần) |
||||
# CMD ["npm", "start"] |
||||
|
Loading…
Reference in new issue