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:
|
services:
|
||||||
frontend:
|
frontend:
|
||||||
build:
|
build:
|
||||||
context: ./frontend
|
context: .
|
||||||
dockerfile: ../docker/frontend/Dockerfile
|
dockerfile: docker/frontend/Dockerfile
|
||||||
container_name: support-frontend
|
container_name: support-frontend
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
|
||||||
- ./frontend:/app
|
|
||||||
- /app/node_modules
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
|
|
||||||
@@ -35,13 +32,11 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
volumes:
|
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
|
- ./docker/nginx/conf.d:/etc/nginx/conf.d:ro
|
||||||
- frontend_build:/usr/share/nginx/html
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- frontend
|
- frontend
|
||||||
- backend
|
- backend
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
sqlite_data:
|
sqlite_data:
|
||||||
frontend_build:
|
|
@@ -3,11 +3,11 @@ FROM node:18-alpine as build
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy package files
|
# Copy package files
|
||||||
COPY frontend/package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
# Copy source code
|
# Copy source code
|
||||||
COPY frontend/ .
|
COPY . .
|
||||||
|
|
||||||
# Build the app
|
# Build the app
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
@@ -17,9 +17,11 @@ FROM nginx:alpine
|
|||||||
# Copy built files
|
# Copy built files
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
COPY --from=build /app/dist /usr/share/nginx/html
|
||||||
|
|
||||||
# Copy nginx configurations
|
# Create nginx config directory
|
||||||
COPY docker/nginx/nginx.conf /etc/nginx/nginx.conf
|
RUN mkdir -p /etc/nginx/conf.d
|
||||||
COPY docker/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
|
|
||||||
|
# Copy nginx configuration
|
||||||
|
COPY ../docker/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
# Create required directories and set permissions
|
# Create required directories and set permissions
|
||||||
RUN mkdir -p /var/cache/nginx \
|
RUN mkdir -p /var/cache/nginx \
|
||||||
@@ -37,4 +39,7 @@ RUN mkdir -p /var/cache/nginx \
|
|||||||
/var/cache/nginx/scgi_temp \
|
/var/cache/nginx/scgi_temp \
|
||||||
/var/run
|
/var/run
|
||||||
|
|
||||||
|
# Remove user directive from nginx config
|
||||||
|
RUN sed -i '/user/d' /etc/nginx/nginx.conf
|
||||||
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["nginx", "-g", "daemon off;"]
|
Reference in New Issue
Block a user