Skip to content

Commit

Permalink
Merge pull request #38 from GSA-TTS/compile-python-bytecode
Browse files Browse the repository at this point in the history
Update Dockerfile
  • Loading branch information
akuny authored Mar 4, 2024
2 parents 2180570 + 703489f commit e0324c9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ ENV CPLUS_INCLUDE_PATH=/usr/include/gdal \
# Install GDAL Python bindings with the specified version
RUN pip install GDAL==$GDAL_VERSION

# Compile Python bytecode for system packages and CWD
RUN python -c "import compileall; compileall.compile_path(maxlevels=10)"

# Install poetry in /opt/poetry
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python3 -
ENV PATH="${PATH}:/opt/poetry/bin"
Expand All @@ -35,6 +38,10 @@ WORKDIR /app
COPY pyproject.toml poetry.lock ./
RUN poetry export -f requirements.txt --output requirements.txt
RUN pip install -r requirements.txt

# Copy application code and compile Python bytecode
COPY . .
RUN python -m compileall /app

USER appuser
CMD ["/bin/sh", "./scripts/start_local.sh"]

0 comments on commit e0324c9

Please sign in to comment.