diff --git a/Dockerfile.autobuild b/Dockerfile.autobuild index e624f41..0ccaba2 100644 --- a/Dockerfile.autobuild +++ b/Dockerfile.autobuild @@ -32,6 +32,7 @@ RUN apt-get update \ # Install Poetry requirements COPY pyproject.toml ./ COPY poetry.lock ./ +COPY docker/pip.conf /etc/ RUN apt-get update && apt-get install libffi-dev cargo -y RUN pip install --upgrade pip \ && pip install poetry \ @@ -48,6 +49,7 @@ ENV CRYPTOGRAPHY_DONT_BUILD_RUST=1 WORKDIR pinry RUN mkdir /data && chown -R www-data:www-data /data +COPY docker/pip.conf /etc/ RUN groupadd -g 2300 tmpgroup \ && usermod -g tmpgroup www-data \ && groupdel www-data \ @@ -58,7 +60,7 @@ RUN groupadd -g 2300 tmpgroup \ RUN apt-get update \ # install libffi to build poetry - && apt-get install libffi-dev cargo -y \ + && apt-get install libffi-dev cargo make -y \ # Install nginx && apt-get -y install nginx pwgen \ # Install Pillow dependencies diff --git a/Makefile b/Makefile index 6f69b88..2ce027a 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,8 @@ collect-static-no-input: bootstrap: make install make collect-static-no-input +serve-gunicorn: + poetry run gunicorn pinry.wsgi -b 0.0.0.0:8000 -w 4 --capture-output --timeout 30 --user www-data --group www-data serve: poetry run python manage.py runserver 0.0.0.0:8000 install: diff --git a/docker/build_docker_multiple_platform.sh b/docker/build_docker_multiple_platform.sh index 8305257..83e150c 100755 --- a/docker/build_docker_multiple_platform.sh +++ b/docker/build_docker_multiple_platform.sh @@ -5,9 +5,18 @@ script_dir="$( dirname "${0}" )" IMAGE_LATEST_TAG="latest" IMAGE_VERSION_TAG=`git tag -l --sort=-creatordate | head -n 1 | sed "s/v//g"` +#sudo docker buildx build \ +# --no-cache \ +# --push \ +# --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \ +# -t getpinry/pinry:${IMAGE_LATEST_TAG} \ +# -t getpinry/pinry:${IMAGE_VERSION_TAG} \ +# "${script_dir}/../" \ +# -f "${script_dir}/../Dockerfile.autobuild" + sudo docker buildx build \ - --push \ - --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \ + --output=type=docker \ + --platform linux/amd64 \ -t getpinry/pinry:${IMAGE_LATEST_TAG} \ -t getpinry/pinry:${IMAGE_VERSION_TAG} \ "${script_dir}/../" \ diff --git a/docker/scripts/_start_gunicorn.sh b/docker/scripts/_start_gunicorn.sh deleted file mode 100755 index 32a80df..0000000 --- a/docker/scripts/_start_gunicorn.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -poetry run gunicorn pinry.wsgi -b 0.0.0.0:8000 -w 4 \ - --capture-output --timeout 30 \ - --user www-data --group www-data diff --git a/docker/scripts/start.sh b/docker/scripts/start.sh index 959a372..3ced08f 100755 --- a/docker/scripts/start.sh +++ b/docker/scripts/start.sh @@ -30,4 +30,4 @@ chown -R www-data:www-data /data /usr/sbin/nginx cd ${PROJECT_ROOT} -./docker/scripts/_start_gunicorn.sh +make serve-gunicorn