Просмотр исходного кода

Added: docker file for production

Fixed: app version changed to 4.0.23
bugfix/2249-fix
dusan.lazarevic 3 лет назад
Родитель
Сommit
2e61c15e84
2 измененных файлов: 15 добавлений и 16 удалений
  1. 13
    14
      Dockerfile
  2. 2
    2
      package.json

+ 13
- 14
Dockerfile Просмотреть файл

FROM node:16

WORKDIR ./src

COPY package*.json ./
COPY src ./
COPY public ./
FROM node:16 AS builder


WORKDIR /app
# Copy all files from current directory to working dir in image
COPY package*.json /app/
RUN npm install RUN npm install
COPY ./ /app/
ENV REACT_APP_BASE_API_URL="https://trampa-api.dilig.net/"
RUN npm run build


ENV NODE_ENV='docker'

# Bundle app source
COPY . .

EXPOSE 3000
CMD [ "npm", "start" ]
FROM nginx:alpine
WORKDIR /usr/share/nginx/html
RUN rm -rf ./*
COPY --from=builder /app/build .
# Containers run nginx with global directives and daemon off
ENTRYPOINT ["nginx", "-g", "daemon off;"]

+ 2
- 2
package.json Просмотреть файл

{ {
"name": "web", "name": "web",
"version": "4.0.15",
"version": "4.0.23",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@emotion/react": "^11.5.0", "@emotion/react": "^11.5.0",
"eslint-plugin-react-hooks": "^4.2.0", "eslint-plugin-react-hooks": "^4.2.0",
"prettier": "2.3.1" "prettier": "2.3.1"
} }
}
}

Загрузка…
Отмена
Сохранить