-
Notifications
You must be signed in to change notification settings - Fork 1
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
98ec6de
commit 8abc19f
Showing
8 changed files
with
159 additions
and
57 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,25 @@ | ||
FROM python:3.13.1-slim-bullseye | ||
RUN apt-get update && apt-get install -y zsh gcc python3-dev git | ||
SHELL ["/bin/zsh", "-c", "-o", "pipefail"] | ||
|
||
RUN if ! getent passwd app; then groupadd -g 1000 app \ | ||
&& useradd -u 1000 -g 1000 -d /home/app -m -s /bin/zsh app; fi \ | ||
&& echo app:app | chpasswd \ | ||
&& echo 'app ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \ | ||
&& mkdir -p /etc/sudoers.d \ | ||
&& echo 'app ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/app \ | ||
&& chmod 0440 /etc/sudoers.d/app \ | ||
&& apt-get autoremove \ | ||
&& apt-get clean -y \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
USER app | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
ENV PATH='/home/app/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin' | ||
RUN pip3 install --user --upgrade pip \ | ||
&& pip3 install poetry \ | ||
&& git config --global user.email "[email protected]" && git config --global user.name "Andy Miles" | ||
WORKDIR /home/app/app | ||
COPY ./pyproject.toml . | ||
RUN /home/app/.local/bin/poetry install | ||
CMD ["/bin/zsh"] |
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,6 @@ | ||
#TBD | ||
FROM python:3.13.1 | ||
|
||
WORKDIR /app | ||
COPY dist/*.whl ./ | ||
RUN pip install $(find . -name "*.whl" -type f -printf "%T@ %p\n" | sort -n | tail -1 | cut -f2- -d" ") |
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,2 @@ | ||
#!/bin/zsh | ||
docker build -t pyhack . |
Large diffs are not rendered by default.
Oops, something went wrong.
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,2 @@ | ||
#!/bin/zsh | ||
docker run --rm -it -v .:/home/app/app --name pyhack pyhack zsh |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"version": 4, | ||
"terraform_version": "1.10.1", | ||
"serial": 1, | ||
"lineage": "cb138770-1fe6-6faa-5599-bff5a0733eb6", | ||
"outputs": {}, | ||
"resources": [], | ||
"check_results": null | ||
} |
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,4 @@ | ||
import tfgha.app | ||
|
||
def test_app(): | ||
assert tfgha.app.hello() == "Hello from Python deployed with poetry" |