From f6451dde6732c8ad2a311c02b2b58a7005631242 Mon Sep 17 00:00:00 2001 From: relikd Date: Tue, 6 Jun 2023 17:21:12 +0200 Subject: [PATCH] feat: update app Dockerfile --- Dockerfile | 18 ++++++++++++------ requirements.txt | 1 + setup.py | 4 +--- 3 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 requirements.txt diff --git a/Dockerfile b/Dockerfile index 1eaa320..47a62da 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,22 @@ FROM python:3.8-alpine +# install base system RUN apk add --no-cache gcc libc-dev linux-headers - -# install pypi packages -COPY . /django_project RUN pip install --upgrade pip -RUN pip install /django_project RUN pip install uWSGI==2.0.21 COPY ./docker/uwsgi.ini /uwsgi.ini -COPY ./scripts /scripts -RUN chmod -R +x /scripts + +# install requirements +WORKDIR /django_project +COPY ./requirements.txt . +RUN pip install -r requirements.txt + +# then scripts (likely wont change often) ENV PATH="/scripts:/py/bin:$PATH" +COPY --chmod=700 ./scripts /scripts + +# finally copy app (likely will invalidate cache) +COPY . . CMD ["on-deploy.sh"] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..c426cbc --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +Django==4.2 diff --git a/setup.py b/setup.py index 63afa74..eb64589 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,5 @@ setup( python_requires='>=3.8', packages=find_packages(), scripts=['manage.py'], - install_requires=[ - 'django==4.2', - ] + install_requires=[], )