aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobby <[email protected]>2023-11-10 18:58:08 -0500
committerBobby <[email protected]>2023-11-10 18:58:08 -0500
commita68eb42dc1df45193b5becca545a3524aeb7fe0e (patch)
treecf7a2a3df5c2dd108e660975d18f6e7684ae6796
parentb937f0571e4047d360bb5822833c8f47d63e419b (diff)
downloadthatcomputerscientist-a68eb42dc1df45193b5becca545a3524aeb7fe0e.tar.xz
thatcomputerscientist-a68eb42dc1df45193b5becca545a3524aeb7fe0e.zip
Update Dockerfile
-rw-r--r--Dockerfile54
1 files changed, 48 insertions, 6 deletions
diff --git a/Dockerfile b/Dockerfile
index a3953968..9d9ec432 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -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"]