mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
change docker
This commit is contained in:
@@ -28,13 +28,23 @@ bot_thread.start()
|
|||||||
|
|
||||||
# CORS middleware
|
# CORS middleware
|
||||||
app.add_middleware(
|
app.add_middleware(
|
||||||
CORSMiddleware,
|
CORSMiddleware,
|
||||||
allow_origins=["*"],
|
allow_origins=[
|
||||||
|
"http://localhost:5173",
|
||||||
|
"http://185.139.70.62:5173",
|
||||||
|
"http://46.233.242.206:5173",
|
||||||
|
"http://185.139.70.62",
|
||||||
|
"http://46.233.242.206",
|
||||||
|
"http://0.0.0.0",
|
||||||
|
],
|
||||||
allow_credentials=True,
|
allow_credentials=True,
|
||||||
allow_methods=["*"],
|
allow_methods=["*"],
|
||||||
allow_headers=["*"],
|
allow_headers=["*"],
|
||||||
)
|
)
|
||||||
|
app.include_router(auth.router, prefix="/api")
|
||||||
|
app.include_router(employees.router, prefix="/api")
|
||||||
|
app.include_router(requests.router, prefix="/api")
|
||||||
|
app.include_router(statistics.router, prefix="/api")
|
||||||
|
|
||||||
# Auth endpoints
|
# Auth endpoints
|
||||||
@app.post("/api/auth/login")
|
@app.post("/api/auth/login")
|
||||||
|
@@ -17,6 +17,8 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- TELEGRAM_BOT_TOKEN=7677506032:AAHEqNUr1lIUfNVbLwaWIaPeKKShsCyz3eo
|
- TELEGRAM_BOT_TOKEN=7677506032:AAHEqNUr1lIUfNVbLwaWIaPeKKShsCyz3eo
|
||||||
- TELEGRAM_CHAT_ID=-1002037023574
|
- TELEGRAM_CHAT_ID=-1002037023574
|
||||||
|
volumes:
|
||||||
|
- sqlite_data:/app/instance
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
image: nginx:alpine
|
image: nginx:alpine
|
||||||
|
@@ -3,11 +3,15 @@ FROM node:18-alpine as build
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy package files
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
|
# Copy source code and build
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
# Production stage
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
COPY --from=build /app/dist /usr/share/nginx/html
|
||||||
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
# docker/nginx/conf.d/default.conf
|
# docker/nginx/conf.d/default.conf
|
||||||
upstream backend {
|
upstream backend {
|
||||||
server backend:8000; # Change port to match FastAPI default
|
server backend:8000;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
@@ -18,7 +18,7 @@ server {
|
|||||||
|
|
||||||
# Proxy API requests
|
# Proxy API requests
|
||||||
location /api/ {
|
location /api/ {
|
||||||
proxy_pass http://backend/; # Remove /api/ from proxy_pass
|
proxy_pass http://backend/api/;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection 'upgrade';
|
proxy_set_header Connection 'upgrade';
|
||||||
@@ -28,10 +28,4 @@ server {
|
|||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Handle favicon
|
|
||||||
location = /favicon.ico {
|
|
||||||
access_log off;
|
|
||||||
log_not_found off;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user