mirror of
https://github.com/danilt2000/Alma-vid.git
synced 2025-12-09 19:49:28 +02:00
Add Docker setup for Alma-vid React app
Introduces Dockerfile, docker-compose.yml, .dockerignore, nginx.conf, and a Docker-specific README to enable containerized builds and deployment for the React application using Node.js and nginx. Includes optimized nginx configuration for static assets, security headers, gzip compression, and React Router support.
This commit is contained in:
24
Dockerfile
Normal file
24
Dockerfile
Normal file
@@ -0,0 +1,24 @@
|
||||
FROM node:18-alpine AS build
|
||||
ARG BUILD_CONFIGURATION=production
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
|
||||
RUN npm ci --only=production
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:alpine AS final
|
||||
WORKDIR /usr/share/nginx/html
|
||||
|
||||
RUN rm -rf ./*
|
||||
|
||||
COPY --from=build /app/build .
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
ENTRYPOINT ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user