Update Dockerfile
Browse files- Dockerfile +23 -3
Dockerfile
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
-
|
| 2 |
-
|
|
|
|
|
|
|
| 3 |
|
| 4 |
# 创建目录并设置正确的权限
|
| 5 |
RUN sudo find / \
|
|
@@ -7,4 +9,22 @@ RUN sudo find / \
|
|
| 7 |
-path /etc -prune -o \
|
| 8 |
-path /dev -prune -o \
|
| 9 |
-path /usr -prune -o \
|
| 10 |
-
-exec chmod 777 {} \;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# build stage
|
| 2 |
+
FROM node:lts-alpine AS build-stage
|
| 3 |
+
|
| 4 |
+
RUN apk update && apk add gcc curl sudo git
|
| 5 |
|
| 6 |
# 创建目录并设置正确的权限
|
| 7 |
RUN sudo find / \
|
|
|
|
| 9 |
-path /etc -prune -o \
|
| 10 |
-path /dev -prune -o \
|
| 11 |
-path /usr -prune -o \
|
| 12 |
+
-exec chmod 777 {} \;
|
| 13 |
+
RUN git clone https://github.com/CorentinTh/it-tools.git
|
| 14 |
+
# Set environment variables for non-interactive npm installs
|
| 15 |
+
ENV NPM_CONFIG_LOGLEVEL warn
|
| 16 |
+
ENV CI true
|
| 17 |
+
WORKDIR /app
|
| 18 |
+
COPY package.json pnpm-lock.yaml ./
|
| 19 |
+
RUN npm install -g pnpm && pnpm i --frozen-lockfile
|
| 20 |
+
COPY . .
|
| 21 |
+
RUN pnpm build
|
| 22 |
+
|
| 23 |
+
# production stage
|
| 24 |
+
FROM nginx:stable-alpine AS production-stage
|
| 25 |
+
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
| 26 |
+
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
| 27 |
+
EXPOSE 80
|
| 28 |
+
CMD ["nginx", "-g", "daemon off;"]
|
| 29 |
+
|
| 30 |
+
|