diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c09188f --- /dev/null +++ b/Dockerfile @@ -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"] \ No newline at end of file