Files
IOT_application/Machine-Backend/Dockerfile
2025-10-14 18:02:33 +05:30

24 lines
515 B
Docker

FROM python:3.10-alpine
WORKDIR /app
# Install dependencies directly without mirror change
RUN apk add --no-cache gcc musl-dev python3-dev mariadb-dev libffi-dev openssl-dev
# Copy requirements and install
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy app code
COPY . .
# Production environment
ENV FLASK_ENV=production
ENV FLASK_APP=run.py
ENV FLASK_RUN_HOST=0.0.0.0
ENV FLASK_RUN_PORT=5000
EXPOSE 5000
# Use Gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "run:app"]