docker change

This commit is contained in:
uniknow 2024-10-04 19:40:50 +04:00
parent 663f537421
commit 95759dd14e
2 changed files with 9 additions and 9 deletions

View file

@ -1,19 +1,19 @@
FROM node:alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
FROM node:alpine
WORKDIR /app
COPY --from=build /app/build ./build
COPY --from=build /app/package*.json ./
FROM nginx:stable-alpine
RUN npm install --only=production
COPY --from=build /build /usr/share/nginx/html
EXPOSE 3000
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
CMD ["node", "build/server/index.js"]

View file

@ -6,7 +6,7 @@ services:
context: ..
dockerfile: docker/Dockerfile
ports:
- "127.0.0.1:7270:80"
- "127.0.0.1:7270:3000"
env_file:
- ../.env
restart: always