feat: Implement containerized deployment with frontend/backend separation

This commit is contained in:
super committed 2026-03-03 10:22:15 +08:00
1 parent 2b8a0010ef
commit f18b6ce2df
5 files changed
+103 -136

No files matched your search

+15 -4
View File
@@ -1,13 +1,24 @@
# backend/Dockerfile
FROM python:3.12-slim
WORKDIR /app
# Install system dependencies
# libpq-dev is required for psycopg2
RUN apt-get update && apt-get install -y \
gcc \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# 使用 Gunicorn + Gevent 启动
CMD ["gunicorn", "-c", "gunicorn_config.py", "run:app"]
# Expose port 5000
EXPOSE 5000
# Start Gunicorn
# Using the config file we created earlier
CMD ["gunicorn", "-c", "deploy/gunicorn_config.py", "run:app"]