From 7220ab849902c510f7ca3419f9a69642cf5ac44c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20G=C3=B3recki?= Date: Fri, 3 Nov 2023 16:28:33 +0100 Subject: [PATCH] update Dockerfile --- Dockerfile | 47 ++--------------------------------------------- Makefile | 2 +- 2 files changed, 3 insertions(+), 46 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8b4488fd..8380a38e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,53 +46,10 @@ ENV BUILD_SHA=${BUILD_SHA} # Copy the production requirements and install them COPY --from=base --chown=promptsail /src/production.txt ./ -RUN pip install --no-cache-dir -r production.txt +RUN printenv && pip install --no-cache-dir -r production.txt # Expose the port the app runs on EXPOSE 8000 # Run the application -CMD uvicorn app:app --proxy-headers --host 0.0.0.0 --port=${PORT:-8000} - - - -#FROM python:3.10.2-slim-buster AS requirements -#ARG BUILD_SHA -# -#ADD pyproject.toml poetry.lock ./ -# -#RUN apt-get update && apt-get install -y curl && \ -# curl -sSL https://install.python-poetry.org | python3 - -# -## just to create virtualenv, maybe there is a better way -#RUN /root/.local/bin/poetry export -f requirements.txt > /dev/null -# -#RUN /root/.local/bin/poetry export -f requirements.txt --without-hashes > req.txt && \ -# sed 's/-e //' req.txt > requirements.txt && \ -# sort requirements.txt > production.txt -# -#RUN /root/.local/bin/poetry export -f requirements.txt --with dev --without-hashes > req.txt && \ -# sed 's/-e //' req.txt > requirements.txt && \ -# sort requirements.txt > all.txt -# -## We need only development dependencies in development.txt (without production requirements) -#RUN comm -3 production.txt all.txt > development.txt -# -#FROM python:3.10.2 AS base -#ENV PYTHONUNBUFFERED 1 -#WORKDIR /src -#COPY --from=requirements production.txt ./ -#RUN apt-get update && rm -rf /var/lib/apt/lists/* && \ -# useradd -u 1000 promptsail && \ -# chown -R promptsail /src && \ -# pip install --no-cache --no-cache-dir -r ./production.txt -# -#COPY src/. /src -#COPY static/. /static -# -#FROM base as production -#ENV BUILD_SHA=${BUILD_SHA} -#USER promptsail -#CMD uvicorn app:app --proxy-headers --host 0.0.0.0 --port=${PORT:-8000} - - +CMD uvicorn app:app --proxy-headers --host 0.0.0.0 --port=${PORT:-8000} \ No newline at end of file diff --git a/Makefile b/Makefile index 79191806..0c8c32bc 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ test: cd src && pytest build: - docker-compose build --build-arg BUILD_SHA=$(BUILD_SHA) + echo "Building $(BUILD_SHA)" && docker-compose build --build-arg BUILD_SHA=$(BUILD_SHA) precommit: pre-commit run --all-files