رفع الملفات إلى "/"
هذا الالتزام موجود في:
36
Dockerfile
Normal file
36
Dockerfile
Normal file
@@ -0,0 +1,36 @@
|
||||
# Build stage for React frontend
|
||||
FROM node:18-alpine AS frontend-build
|
||||
WORKDIR /app/frontend
|
||||
COPY frontend/package*.json ./
|
||||
RUN npm install
|
||||
COPY frontend/ ./
|
||||
RUN npm run build
|
||||
|
||||
# Production stage for Python backend
|
||||
FROM python:3.11-slim
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies for database clients
|
||||
RUN apt-get update && apt-get install -y \
|
||||
default-mysql-client \
|
||||
postgresql-client \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy built frontend
|
||||
COPY --from=frontend-build /app/dist ./dist
|
||||
|
||||
# Copy backend
|
||||
COPY backend/ ./backend/
|
||||
|
||||
# Install Python dependencies
|
||||
RUN pip install --no-cache-dir -r backend/requirements.txt gunicorn
|
||||
|
||||
# Environment variables
|
||||
ENV FLASK_APP=backend/app.py
|
||||
ENV PORT=8000
|
||||
|
||||
# Expose port
|
||||
EXPOSE 8000
|
||||
|
||||
# Run with gunicorn
|
||||
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "backend.app:app"]
|
||||
المرجع في مشكلة جديدة
حظر مستخدم