-
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.
Merge pull request #6 from reef-technologies/docker_image
docker image publishing
- Loading branch information
Showing
4 changed files
with
148 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
...TTER{% if cookiecutter.build_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__ |
36 changes: 36 additions & 0 deletions
36
...ECUTTER{% if cookiecutter.build_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,36 @@ | ||
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 | ||
|
||
ENV PDM_VERSION=2.18.1 | ||
RUN curl -sSL https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py | python3 - | ||
|
||
ENV PATH="/root/.local/bin:$PATH" | ||
|
||
COPY . . | ||
|
||
ENV PDM_CHECK_UPDATE=false | ||
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