Skip to content

Commit

Permalink
update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
pgorecki committed Nov 3, 2023
1 parent 68599e3 commit 7220ab8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 46 deletions.
47 changes: 2 additions & 45 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7220ab8

Please sign in to comment.