-
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.
fix: update Dockerfile and update ci-cd.yml
- Loading branch information
1 parent
8b7951e
commit 4529c59
Showing
2 changed files
with
30 additions
and
3 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
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,7 +1,32 @@ | ||
# Use an official Python runtime as a parent image | ||
FROM python:3.11-slim as builder | ||
|
||
# Install system dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Create a virtual environment in /venv | ||
RUN python -m venv /venv | ||
|
||
# Activate virtual environment and upgrade pip | ||
ENV PATH="/venv/bin:$PATH" | ||
RUN pip install --upgrade pip | ||
|
||
# Install the latest version of the chaturbate-poller package | ||
RUN pip install --no-cache-dir chaturbate-poller | ||
|
||
# Create a new stage for the final image | ||
FROM python:3.11-slim | ||
|
||
RUN pip install --no-cache-dir --no-compile chaturbate-poller | ||
# Copy the virtual environment from the builder stage | ||
COPY --from=builder /venv /venv | ||
|
||
# Set the path to use the virtual environment | ||
ENV PATH="/venv/bin:$PATH" | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Command to run the application | ||
ENTRYPOINT ["python", "-m", "chaturbate_poller"] |