Skip to content

Commit

Permalink
try with different dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
fpgmaas committed Jun 17, 2024
1 parent 1d3de08 commit c0c0627
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Exclude all files
**

# Include only necessary directories and files
!pypi_scout/
!poetry.lock
!pyproject.toml
!start.sh
18 changes: 11 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,31 @@ FROM python:3.10-slim-bookworm
ENV POETRY_VERSION=1.6 \
POETRY_VIRTUALENVS_CREATE=false

# Install poetry
RUN pip install "poetry==$POETRY_VERSION"
# Install poetry and clean up
RUN pip install "poetry==$POETRY_VERSION" && \
rm -rf /root/.cache/pip

# Copy only requirements to cache them in docker layer
# Set work directory
WORKDIR /code

# Copy only requirements to cache them in docker layer
COPY poetry.lock pyproject.toml /code/

# Project initialization:
RUN poetry install --no-interaction --no-ansi --no-root --no-dev
# Install project dependencies and clean up
RUN poetry install --no-interaction --no-ansi --no-root --no-dev && \
rm -rf /root/.cache/pip

# Copy Python code to the Docker image
COPY pypi_scout /code/pypi_scout/

ENV PYTHONPATH=/code

# Copy the start script and make executable
COPY start.sh /start.sh
RUN chmod +x /start.sh

# Make empty data directory
RUN mkdir -p /code/data

ENV PYTHONPATH=/code

# Use the script as the entrypoint
ENTRYPOINT ["/start.sh"]

0 comments on commit c0c0627

Please sign in to comment.