-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |