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 FROM node:alpine AS build
WORKDIR /app
COPY package*.json ./ COPY package*.json ./
RUN npm install RUN npm install
COPY . . COPY . .
RUN npm run build 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 ["node", "build/server/index.js"]
CMD ["nginx", "-g", "daemon off;"]

View file

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