mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
cha25
This commit is contained in:
@@ -3,13 +3,10 @@ version: '3.8'
|
||||
services:
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
dockerfile: ../docker/frontend/Dockerfile
|
||||
context: .
|
||||
dockerfile: docker/frontend/Dockerfile
|
||||
container_name: support-frontend
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./frontend:/app
|
||||
- /app/node_modules
|
||||
depends_on:
|
||||
- backend
|
||||
|
||||
@@ -35,13 +32,11 @@ services:
|
||||
ports:
|
||||
- "80:80"
|
||||
volumes:
|
||||
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
- ./frontend/dist:/usr/share/nginx/html
|
||||
- ./docker/nginx/conf.d:/etc/nginx/conf.d:ro
|
||||
- frontend_build:/usr/share/nginx/html
|
||||
depends_on:
|
||||
- frontend
|
||||
- backend
|
||||
|
||||
volumes:
|
||||
sqlite_data:
|
||||
frontend_build:
|
@@ -3,11 +3,11 @@ FROM node:18-alpine as build
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files
|
||||
COPY frontend/package*.json ./
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
|
||||
# Copy source code
|
||||
COPY frontend/ .
|
||||
COPY . .
|
||||
|
||||
# Build the app
|
||||
RUN npm run build
|
||||
@@ -17,9 +17,11 @@ FROM nginx:alpine
|
||||
# Copy built files
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
|
||||
# Copy nginx configurations
|
||||
COPY docker/nginx/nginx.conf /etc/nginx/nginx.conf
|
||||
COPY docker/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
|
||||
# Create nginx config directory
|
||||
RUN mkdir -p /etc/nginx/conf.d
|
||||
|
||||
# Copy nginx configuration
|
||||
COPY ../docker/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Create required directories and set permissions
|
||||
RUN mkdir -p /var/cache/nginx \
|
||||
@@ -37,4 +39,7 @@ RUN mkdir -p /var/cache/nginx \
|
||||
/var/cache/nginx/scgi_temp \
|
||||
/var/run
|
||||
|
||||
# Remove user directive from nginx config
|
||||
RUN sed -i '/user/d' /etc/nginx/nginx.conf
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
Reference in New Issue
Block a user