@@ -20,31 +20,40 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2020 && rm -rf /var/lib/apt/lists/* \
2121 && apt-get clean
2222
23- # Install Python dependencies
23+ # Copy requirements first to leverage Docker cache
2424COPY requirements.txt .
2525RUN pip install --no-cache-dir -r requirements.txt
2626
27- # Copy project files
28- COPY . .
29-
30- # Install the package in development mode
31- RUN pip install -e .
32-
3327# Create necessary directories with proper permissions
3428RUN mkdir -p /app/src/bluesky_notify/data /app/logs /app/instance \
3529 && chmod -R 777 /app/src/bluesky_notify/data \
3630 && chmod -R 777 /app/logs \
3731 && chmod 777 /app/instance
3832
39- # Create a non-root user and set ownership
33+ # Create a non-root user
4034RUN useradd -m -r appuser \
4135 && chown -R appuser:appuser /app
4236
37+ # Copy project files
38+ COPY --chown=appuser:appuser . .
39+
40+ # Install the package
41+ RUN pip install --no-cache-dir .
42+
43+ # Switch to non-root user
4344USER appuser
4445
46+ # Expose the application port
47+ EXPOSE 5001
48+
4549# Health check
4650HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
4751 CMD python -c "import requests; requests.get('http://localhost:5001/health')"
4852
4953# Run the application
5054CMD ["python" , "run.py" ]
55+
56+ # Set labels
57+ LABEL org.opencontainers.image.source="https://github.com/jerdog/bluesky-notify"
58+ LABEL org.opencontainers.image.description="A cross-platform notification system for tracking and receiving alerts about new Bluesky social media posts."
59+ LABEL org.opencontainers.image.licenses="MIT"
0 commit comments