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 17:00:58 +06:00
parent a7262139d5
commit e2b4d00558
4 changed files with 39 additions and 41 deletions

View File

@@ -6,7 +6,8 @@ services:
context: . context: .
dockerfile: docker/frontend/Dockerfile dockerfile: docker/frontend/Dockerfile
container_name: support-frontend container_name: support-frontend
restart: unless-stopped ports:
- "80:80"
depends_on: depends_on:
- backend - backend
@@ -15,7 +16,6 @@ services:
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
@@ -23,19 +23,7 @@ services:
- ./backend:/app - ./backend:/app
- sqlite_data:/app/instance - sqlite_data:/app/instance
ports: ports:
- "8081:8000" - "8000:8000"
nginx:
build:
context: ./docker/nginx
dockerfile: Dockerfile
container_name: support-nginx
restart: unless-stopped
ports:
- "80:80"
depends_on:
- frontend
- backend
volumes: volumes:
sqlite_data: sqlite_data:

View File

@@ -1,4 +1,4 @@
FROM node:18-alpine FROM node:18-alpine as build
WORKDIR /app WORKDIR /app
@@ -10,4 +10,36 @@ RUN npm install
COPY frontend/ . COPY frontend/ .
# Build the app # Build the app
CMD ["npm", "run", "build"] RUN 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;"]

View File

@@ -1,22 +0,0 @@
FROM nginx:alpine
# Copy configuration files
COPY nginx.conf /etc/nginx/nginx.conf
COPY 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 -R 755 /var/cache/nginx \
&& chmod -R 755 /etc/nginx \
&& chown -R nginx:nginx /var/cache/nginx \
&& chown -R nginx:nginx /etc/nginx
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

View File

@@ -11,8 +11,8 @@ http {
include /etc/nginx/mime.types; include /etc/nginx/mime.types;
default_type application/octet-stream; default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' log_format main '$remote_addr - $remote_user [$time_local] "$request"'
'$status $body_bytes_sent "$http_referer" ' '$status $body_bytes_sent "$http_referer"'
'"$http_user_agent" "$http_x_forwarded_for"'; '"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main; access_log /var/log/nginx/access.log main;