-
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
045d80d
commit 936713b
Showing
4 changed files
with
146 additions
and
13 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
17 changes: 17 additions & 0 deletions
17
...OKIECUTTER{% if cookiecutter.docker_image == "y" %}.dockerignore# COOKIECUTTER{% endif %}
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,17 @@ | ||
.git | ||
*.pyc | ||
*.sqlite3 | ||
*~ | ||
*.egg-info/ | ||
/.idea/ | ||
.env | ||
.venv | ||
venv | ||
media/ | ||
.backups/ | ||
.envrc | ||
.pdm-python | ||
.terraform.lock.hcl | ||
.terraform/ | ||
.nox/ | ||
__pycache__ |
34 changes: 34 additions & 0 deletions
34
... COOKIECUTTER{% if cookiecutter.docker_image == "y" %}Dockerfile# COOKIECUTTER{% endif %}
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,34 @@ | ||
ARG PYTHON_VERSION=3.12 | ||
FROM python:${PYTHON_VERSION}-alpine AS builder | ||
|
||
WORKDIR /app | ||
|
||
RUN apk add --no-cache \ | ||
curl \ | ||
gcc \ | ||
musl-dev \ | ||
libffi-dev \ | ||
openssl-dev | ||
|
||
RUN curl -sSL https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py | python3 - | ||
|
||
ENV PATH="/root/.local/bin:$PATH" | ||
|
||
COPY . . | ||
|
||
RUN pdm export > /tmp/requirements.txt | ||
|
||
ARG PDM_BUILD_SCM_VERSION="0.0.1" | ||
RUN pdm build -d /tmp/wheelhouse | ||
|
||
RUN pip install --no-cache-dir -r /tmp/requirements.txt | ||
RUN pip install --no-cache-dir /tmp/wheelhouse/*.whl | ||
|
||
FROM python:${PYTHON_VERSION}-alpine | ||
|
||
COPY --from=builder /usr/local/lib/python${PYTHON_VERSION%.*}/site-packages /usr/local/lib/python${PYTHON_VERSION%.*}/site-packages | ||
COPY --from=builder /usr/local/bin /usr/local/bin | ||
|
||
ENV PATH="/usr/local/bin:$PATH" | ||
|
||
ENTRYPOINT ["{{ cookiecutter.package_name | replace('_', '-') }}"] |
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