diff --git a/Pipfile.lock b/Pipfile.lock index b00e017..0d84b65 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,11 +1,11 @@ { "_meta": { "hash": { - "sha256": "3308c52323d766f8ec2f955aa12fa27745df89a209b5ac913bd6e3687f161d38" + "sha256": "79fd1119e3bf8411842d89a3a7c370d4b5741b33f2f181fadf934a57e5553e63" }, "pipfile-spec": 6, "requires": { - "python_version": "3" + "python_version": "3.10" }, "sources": [ { @@ -470,7 +470,7 @@ "sha256:fd096eb7ffef17c456cfa587523c5f92321ae02427ff955bebe9e3c63bc9f0da", "sha256:fe754d231288e1e64323cfad462fcee8f0288654c10bdf4f603a39ed923bef33" ], - "markers": "python_version >= '3' and platform_machine == 'aarch64' or (platform_machine == 'ppc64le' or (platform_machine == 'x86_64' or (platform_machine == 'amd64' or (platform_machine == 'AMD64' or (platform_machine == 'win32' or platform_machine == 'WIN32')))))", + "markers": "python_version >= '3' and (platform_machine == 'aarch64' or (platform_machine == 'ppc64le' or (platform_machine == 'x86_64' or (platform_machine == 'amd64' or (platform_machine == 'AMD64' or (platform_machine == 'win32' or platform_machine == 'WIN32'))))))", "version": "==3.0.3" }, "grpcio": { diff --git a/docker/Dockerfile b/docker/Dockerfile index b119ed2..cf391bc 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -8,17 +8,18 @@ ENV KASPAD_HOST_1=n.seeder1.kaspad.net:16110 ARG version ENV VERSION=$version -RUN pip install --upgrade pip - -RUN pip install \ - pipenv +# Install & use pipenv +COPY Pipfile Pipfile.lock ./ +RUN python -m pip install --upgrade pip +RUN pip install pipenv && pipenv install --dev --system --deploy WORKDIR /app +COPY . /app -COPY --chown=api:api . /app - -RUN pipenv install --deploy -v +# 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 -ENTRYPOINT ["/usr/bin/dumb-init", "--"] +# ENTRYPOINT ["/usr/bin/dumb-init", "--"] CMD pipenv run gunicorn -b 0.0.0.0:8000 -w 1 -k uvicorn.workers.UvicornWorker main:app --timeout 120