-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c8685a7
commit 19faf38
Showing
1 changed file
with
4 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |