1
0
mirror of https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git synced 2025-08-14 00:25:46 +02:00

cha2524222fvdfа

This commit is contained in:
MoonTestUse1
2024-12-24 16:50:31 +06:00
parent ff0ee37eba
commit ce4578ab17
2 changed files with 21 additions and 40 deletions

View File

@@ -1,29 +1,42 @@
version: '3.8' version: '3.8'
services: services:
nginx:
image: nginx:alpine
container_name: support-nginx
ports:
- "80:80"
volumes:
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./docker/nginx/conf.d:/etc/nginx/conf.d:ro
- frontend_build:/usr/share/nginx/html
depends_on:
- frontend
- backend
frontend: frontend:
build: build:
context: . context: .
dockerfile: docker/frontend/Dockerfile dockerfile: docker/frontend/Dockerfile
container_name: support-frontend container_name: support-frontend
ports: volumes:
- "80:80" - frontend_build:/app/dist
depends_on:
- backend
backend: backend:
build: build:
context: . context: .
dockerfile: docker/backend/Dockerfile dockerfile: docker/backend/Dockerfile
container_name: support-backend container_name: support-backend
restart: unless-stopped
environment: environment:
- TELEGRAM_BOT_TOKEN=7677506032:AAHEqNUr1lIUfNVbLwaWIaPeKKShsCyz3eo - TELEGRAM_BOT_TOKEN=7677506032:AAHEqNUr1lIUfNVbLwaWIaPeKKShsCyz3eo
- TELEGRAM_CHAT_ID=-1002037023574 - TELEGRAM_CHAT_ID=-1002037023574
volumes: volumes:
- ./backend:/app - ./backend:/app
- sqlite_data:/app/instance - sqlite_data:/app/instance
ports: expose:
- "8000:8000" - "8000"
volumes: volumes:
sqlite_data: sqlite_data:
frontend_build:

View File

@@ -1,4 +1,4 @@
FROM node:18-alpine as build FROM node:18-alpine
WORKDIR /app WORKDIR /app
@@ -10,36 +10,4 @@ RUN npm install
COPY frontend/ . COPY frontend/ .
# Build the app # Build the app
RUN npm run build CMD ["npm", "run", "build"]
FROM nginx:alpine
# Copy built files
COPY --from=build /app/dist /usr/share/nginx/html
# 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 \
/var/cache/nginx/client_temp \
/var/cache/nginx/proxy_temp \
/var/cache/nginx/fastcgi_temp \
/var/cache/nginx/uwsgi_temp \
/var/cache/nginx/scgi_temp \
/var/run \
&& chmod 777 /var/cache/nginx \
/var/cache/nginx/client_temp \
/var/cache/nginx/proxy_temp \
/var/cache/nginx/fastcgi_temp \
/var/cache/nginx/uwsgi_temp \
/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;"]