Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
chatbot-canifa-dev-experimentall
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
chatbot-canifa-dev-experimentall
Commits
453ef792
Commit
453ef792
authored
Mar 17, 2026
by
Vũ Hoàng Anh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: multi-stage Dockerfile, remove workers, fix docker-compose prod
parent
1d44f574
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
14 deletions
+27
-14
.dockerignore
backend/.dockerignore
+10
-0
Dockerfile.prod
backend/Dockerfile.prod
+13
-10
docker-compose.prod.yml
backend/docker-compose.prod.yml
+4
-4
No files found.
backend/.dockerignore
View file @
453ef792
__pycache__
*.pyc
*.pyo
.env
.env.*
.venv
venv
.git
...
...
@@ -8,3 +10,11 @@ venv
.dockerignore
logs
data
*.md
*.txt
!requirements.txt
tests/
.agent/
.agents/
dashboard_debug.png
dashboard_fixed.png
backend/Dockerfile.prod
View file @
453ef792
# ── Stage 1: Builder ──
FROM python:3.11-slim AS builder
FROM python:3.11-slim
WORKDIR /build
COPY requirements.txt .
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
WORKDIR /app
# ── Stage 2: Runtime (minimal) ──
FROM python:3.11-slim
WORKDIR /app
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV ENV=
development
ENV ENV=
production
COPY requirements.txt .
RUN pip install -r requirements.txt
# Copy only installed packages from builder
COPY --from=builder /install /usr/local
COPY . .
EXPOSE 5000
ENV WORKERS=16
ENV TIMEOUT=60
EXPOSE 5005
CMD
gunicorn server:app --workers $WORKERS --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:5000 --timeout $TIMEOUT
CMD
["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "5005", "--timeout-keep-alive", "65"]
backend/docker-compose.prod.yml
View file @
453ef792
...
...
@@ -8,20 +8,20 @@ services:
env_file
:
.env
ports
:
-
"
5005:5005"
volumes
:
-
.:/app
environment
:
-
PORT=5005
-
ENV=production
restart
:
unless-stopped
deploy
:
resources
:
limits
:
memory
:
8
g
memory
:
4
g
networks
:
-
backend_network
logging
:
driver
:
"
json-file"
options
:
max-size
:
"
50m"
max-file
:
"
3"
tag
:
"
{{.Name}}"
networks
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment