Skip to content
This repository has been archived by the owner on Aug 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #19 from jogerj/main
Browse files Browse the repository at this point in the history
feat(docker): docker compose and minimal build
  • Loading branch information
totoroterror authored Aug 21, 2023
2 parents 833a01a + d056f1e commit 67f1ee7
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 14 deletions.
16 changes: 16 additions & 0 deletions .dockerignore
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
24 changes: 18 additions & 6 deletions Dockerfile
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"]
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
services:
runner:
build: .
restart: unless-stopped
16 changes: 8 additions & 8 deletions requirements.txt
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

0 comments on commit 67f1ee7

Please sign in to comment.