Skip to content

Instantly share code, notes, and snippets.

@wathika-eng
Created July 25, 2024 11:56
Show Gist options
  • Select an option

  • Save wathika-eng/c186e99fec5e98bdc72bfd0d1559b178 to your computer and use it in GitHub Desktop.

Select an option

Save wathika-eng/c186e99fec5e98bdc72bfd0d1559b178 to your computer and use it in GitHub Desktop.
# sample dockerfile for a flask application
FROM python:3.10-slim
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN useradd -m testuser
USER myuser
COPY .env .
ENV FLASK_APP=App.py
ENV FLASK_RUN_HOST=0.0.0.0
ENV FLASK_RUN_PORT=8000
CMD ["flask", "run"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment