Skip to content

Commit

Permalink
fix: simplify Dockerfile logic
Browse files Browse the repository at this point in the history
  • Loading branch information
MountainGod2 committed Aug 8, 2024
1 parent c8685a7 commit 19faf38
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
# Use the official Python image from the Docker Hub
FROM python:3.11-slim-buster

# Install Poetry
RUN pip install poetry==1.4.2
# Install the program and its dependencies using pip
RUN pip install chaturbate-poller

# Set working directory
WORKDIR /app

# Copy only the dependency files first for better caching
COPY pyproject.toml poetry.lock ./

# Install dependencies without dev dependencies
RUN poetry install --only main

# Create a non-root user and switch to it
RUN useradd -m myuser && chown -R myuser:myuser /app
USER myuser

# Set the working directory
WORKDIR /app

# Set environment variables
ENV PATH="/app/.venv/bin:$PATH"

# Command to run the CLI program
ENTRYPOINT ["poetry", "run", "chaturbate_poller"]
# Run the program
ENTRYPOINT ["python" "-m" "chaturbate_poller"]

0 comments on commit 19faf38

Please sign in to comment.