设置了Docker构建方式

This commit is contained in:
2023-12-22 11:58:13 +00:00
parent 369a29b824
commit 91b69a2150
3 changed files with 15 additions and 1 deletions

10
Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM node:20.10
LABEL maintainer="ZhuangYumin <zhuangyumin@sjtu.edu.cn>"
COPY . /bookstore/
RUN apt-get update && apt-get install -y g++ && apt-get install -y cmake
WORKDIR /bookstore/
RUN mkdir data
RUN mkdir build && cd build && cmake -B . -S .. && cmake --build . && cd ../frontend/Web && npm install
WORKDIR /bookstore/frontend/Web
EXPOSE 3000
CMD ["node","index.js","/bookstore/data/"]