Skip to content

Commit

Permalink
Docker: better init management.
Browse files Browse the repository at this point in the history
  • Loading branch information
mhvis committed Aug 27, 2022
1 parent 09acaff commit 1dace22
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
FROM python:3.10

# I add Tini for better init management.
# See https://github.com/krallin/tini
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini

ENV PYTHONUNBUFFERED=1
WORKDIR /usr/src/app

COPY requirements.txt ./

RUN pip install --no-cache-dir -r requirements.txt

# The .dockerignore file only includes necessary files/folders
COPY . .
RUN pip install --no-cache-dir .

ENTRYPOINT ["/tini", "--", "/usr/local/bin/samil"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The image is currently not built for ARM platforms like Raspberry Pi,
so for these platforms you need to build it yourself or install via pip.

```
docker run --network host mhvis/samil samil monitor
docker run --network host mhvis/samil monitor
```

Here is a sample `compose.yaml`:
Expand All @@ -51,7 +51,7 @@ name: "samil"
services:
samil:
image: mhvis/samil
command: samil monitor # Adapt as desired
command: monitor # Adapt as desired
network_mode: host
restart: unless-stopped
```
Expand Down

0 comments on commit 1dace22

Please sign in to comment.