This repository has been archived by the owner on Aug 24, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 163
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 #19 from jogerj/main
feat(docker): docker compose and minimal build
- Loading branch information
Showing
4 changed files
with
46 additions
and
14 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,16 @@ | ||
# https://github.com/garygitton/dockerignore | ||
# Common | ||
README.md | ||
CHANGELOG.md | ||
docker-compose.yml | ||
Dockerfile | ||
.dockerignore | ||
|
||
# git | ||
.git | ||
.github | ||
.gitattributes | ||
.gitignore | ||
|
||
.editorconfig | ||
.env.example |
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,13 +1,25 @@ | ||
FROM python:3.11-alpine | ||
FROM alpine:3.18 AS compile-image | ||
|
||
RUN apk update | ||
RUN apk add make automake gcc g++ subversion python3-dev libffi-dev | ||
RUN apk add --no-cache make automake gcc g++ subversion python3-dev libffi-dev | ||
|
||
WORKDIR /app | ||
|
||
COPY ./requirements.txt requirements.txt | ||
RUN pip install -r requirements.txt | ||
COPY ./requirements.txt /app/ | ||
RUN python3 -m venv /app | ||
RUN /app/bin/pip install -r requirements.txt | ||
RUN rm -rf /app/lib/python3.11/site-packages/setuptools* && \ | ||
rm -rf /app/lib/python3.11/site-packages/pip* && \ | ||
rm -rf /app/bin/pip* | ||
|
||
COPY . . | ||
FROM alpine:3.18 AS runtime-image | ||
|
||
CMD ["python3", "src/main.py"] | ||
RUN apk add --no-cache python3 | ||
|
||
WORKDIR /app | ||
|
||
COPY . /app | ||
|
||
COPY --from=compile-image /app/ ./ | ||
|
||
CMD ["/app/bin/python3", "src/main.py"] |
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 @@ | ||
services: | ||
runner: | ||
build: . | ||
restart: unless-stopped |
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,8 +1,8 @@ | ||
aiodns==3.0.0 | ||
aiohttp==3.8.5 | ||
aiohttp-socks==0.7.1 | ||
loguru==0.6.0 | ||
pydantic==1.10.2 | ||
python-dotenv==0.21.0 | ||
typing_extensions==4.4.0 | ||
cryptography==41.0.3 | ||
aiodns~=3.0.0 | ||
aiohttp~=3.8.5 | ||
aiohttp-socks~=0.7.1 | ||
loguru~=0.6.0 | ||
pydantic~=1.10.2 | ||
python-dotenv~=0.21.0 | ||
typing_extensions~=4.4.0 | ||
cryptography~=41.0.3 |