Skip to content

Commit 7b74f39

Browse files
authored
Update Dockerfile
1 parent 415626e commit 7b74f39

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

Dockerfile

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
FROM python:3.10-slim
33

44
# Set environment variables
5-
ENV PYTHONDONTWRITEBYTECODE 1
6-
ENV PYTHONUNBUFFERED 1
5+
ENV PYTHONDONTWRITEBYTECODE=1
6+
ENV PYTHONUNBUFFERED=1
77

88
# Install system dependencies
99
RUN apt-get update && apt-get install -y \
@@ -18,18 +18,22 @@ RUN addgroup --system omnipkg && adduser --system --ingroup omnipkg omnipkg
1818
# Set the working directory
1919
WORKDIR /home/omnipkg
2020

21-
# Copy requirements and install Python dependencies
22-
# Copy first to leverage Docker layer caching
21+
# Copy project files (including src/) BEFORE installing
2322
COPY --chown=omnipkg:omnipkg pyproject.toml poetry.lock* ./
24-
RUN pip install .
23+
COPY --chown=omnipkg:omnipkg src/ ./src/
24+
COPY --chown=omnipkg:omnipkg README.md ./
2525

26-
# Copy the rest of the application code
27-
COPY --chown=omnipkg:omnipkg . .
26+
# Install Python dependencies
27+
RUN pip install --no-cache-dir .
2828

29-
# Create directories for omnipkg data as the correct user
30-
# Switched the order: chown the directory, then switch user, then create subdir
31-
RUN chown -R omnipkg:omnipkg /home/omnipkg
29+
# Copy the rest of the application code (entrypoint script, etc.)
30+
COPY --chown=omnipkg:omnipkg docker-entrypoint.sh ./
31+
RUN chmod +x /home/omnipkg/docker-entrypoint.sh
32+
33+
# Switch to non-root user
3234
USER omnipkg
35+
36+
# Create directories for omnipkg data
3337
RUN mkdir -p /home/omnipkg/.omnipkg
3438

3539
# Expose Redis port (in case external access needed)

0 commit comments

Comments
 (0)