diff options
| author | Bobby <[email protected]> | 2023-11-10 18:58:08 -0500 |
|---|---|---|
| committer | Bobby <[email protected]> | 2023-11-10 18:58:08 -0500 |
| commit | a68eb42dc1df45193b5becca545a3524aeb7fe0e (patch) | |
| tree | cf7a2a3df5c2dd108e660975d18f6e7684ae6796 /Dockerfile | |
| parent | b937f0571e4047d360bb5822833c8f47d63e419b (diff) | |
| download | thatcomputerscientist-a68eb42dc1df45193b5becca545a3524aeb7fe0e.tar.xz thatcomputerscientist-a68eb42dc1df45193b5becca545a3524aeb7fe0e.zip | |
Update Dockerfile
Diffstat (limited to 'Dockerfile')
| -rw-r--r-- | Dockerfile | 54 |
1 files changed, 48 insertions, 6 deletions
@@ -1,6 +1,6 @@ -ARG PYTHON_VERSION=3.9 +ARG PYTHON_VERSION=3.11-slim-bullseye -FROM python:${PYTHON_VERSION} +FROM python:${PYTHON_VERSION} AS base RUN apt-get update && apt-get install -y \ python3-pip \ @@ -9,19 +9,61 @@ RUN apt-get update && apt-get install -y \ python3-setuptools \ python3-wheel -RUN mkdir -p /app -WORKDIR /app +ENV PYTHONDONTWRITEBYTEshifoo 1 +ENV PYTHONUNBUFFERED 1 + +RUN mkdir -p /shifoo + +WORKDIR /shifoo COPY requirements.txt . + +RUN python3 -m venv /shifoo/venv + +RUN /shifoo/venv/bin/pip install --upgrade pip + +RUN source /shifoo/venv/bin/activate + RUN pip install -r requirements.txt -COPY . ./app +COPY . . RUN python manage.py collectstatic --noinput +RUN python manage.py makemigrations + RUN python manage.py migrate EXPOSE 8080 -# replace APP_NAME with module name CMD ["gunicorn", "--bind", ":8080", "--workers", "2", "thatcomputerscientist.wsgi"] + +# # OUTDATED +# ARG PYTHON_VERSION=3.9 + +# FROM python:${PYTHON_VERSION} + +# RUN apt-get update && apt-get install -y \ +# python3-pip \ +# python3-venv \ +# python3-dev \ +# python3-setuptools \ +# python3-wheel + +# RUN mkdir -p /app +# WORKDIR /app + +# COPY requirements.txt . +# RUN pip install -r requirements.txt + +# COPY . . + +# RUN python manage.py collectstatic --noinput + +# RUN python manage.py migrate + + +# EXPOSE 8080 + +# # replace APP_NAME with module name +# CMD ["gunicorn", "--bind", ":8080", "--workers", "2", "thatcomputerscientist.wsgi"] |
