-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pydiscordsh): adding the base dockerfile
- Loading branch information
Showing
3 changed files
with
68 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Base image with Python and Poetry pre-installed | ||
FROM python:3.11-slim | ||
|
||
# Set environment variables for Poetry and Python | ||
ENV PYTHONUNBUFFERED=1 \ | ||
PIP_NO_CACHE_DIR=1 \ | ||
POETRY_VERSION=1.8.2 \ | ||
POETRY_HOME="/opt/poetry" \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=true \ | ||
POETRY_NO_INTERACTION=1 | ||
|
||
# Install system dependencies and Poetry | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
curl \ | ||
git \ | ||
&& curl -sSL https://install.python-poetry.org | python3 - \ | ||
&& ln -s /opt/poetry/bin/poetry /usr/local/bin/poetry \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy only the relevant files for dependency installation first | ||
COPY pyproject.toml poetry.lock ./ | ||
|
||
# Install dependencies with Poetry (including project dependencies) | ||
RUN poetry install --no-root --only main | ||
|
||
# Copy the rest of the app code | ||
COPY . . | ||
|
||
# Install the project itself (if it's structured as a package) | ||
RUN poetry install --no-dev | ||
|
||
# Set the default command to run the application | ||
CMD ["poetry", "run", "python", "-m", "pydiscordsh"] |
Empty file.
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