Sergey Karmanov 31243f70ad
Some checks failed
Create and publish a Docker image / Publish image (push) Failing after 11s
Create and publish a Docker image / Deploy image (push) Has been skipped
Добавил CI/CD
2023-12-24 13:27:50 +03:00

17 lines
519 B
Docker

FROM node:20-alpine3.17 AS builder
WORKDIR /app
COPY package.json package-lock.json .eslintrc.cjs vite.config.ts index.html ./
COPY public/ public/
COPY src/ src/
RUN npm ci
RUN npm run build
FROM nginx:1.25.2-alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/build /usr/share/nginx/html
RUN touch /var/run/nginx.pid
RUN chown -R nginx:nginx /var/run/nginx.pid /usr/share/nginx/html /var/cache/nginx /var/log/nginx /etc/nginx/conf.d
USER nginx
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]