22FROM 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
99RUN 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
1919WORKDIR /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
2322COPY --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
3234USER omnipkg
35+
36+ # Create directories for omnipkg data
3337RUN mkdir -p /home/omnipkg/.omnipkg
3438
3539# Expose Redis port (in case external access needed)
0 commit comments