Skip to content

Commit

Permalink
update dockerfile for pipenv
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewhrit committed Nov 11, 2024
1 parent caf1e12 commit 8a4957a
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
FROM python:3.10.14-slim
FROM python:3.12.5-slim

RUN mkdir /opt/redeyes
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1

COPY . /opt/redeyes
WORKDIR /opt/redeyes
# Install & use pipenv
COPY Pipfile Pipfile.lock ./
RUN python -m pip install --upgrade pip
RUN pip install pipenv && pipenv install --dev --system --deploy

RUN pip3 install --upgrade pip && pip install --no-cache-dir -r requirements.txt
WORKDIR /app
COPY . /app

# Creates a non-root user and adds permission to access the /app folder
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
USER appuser

# Gunicorn
RUN pip install --no-cache-dir gunicorn

# During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug
CMD ["python", "-m", "gunicorn", "redeyes.wsgi", "-b", "0.0.0.0:8000"]

0 comments on commit 8a4957a

Please sign in to comment.