no need tini is built on docker

This commit is contained in:
Lorenzo Carbonell 2022-05-15 09:35:20 +02:00
parent d643e6951f
commit 71b8e47a65
5 changed files with 10 additions and 8 deletions

1
pastebin/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
db

View File

@ -15,13 +15,11 @@ RUN git clone https://github.com/mkaczanowski/pastebin.git . && \
FROM debian:buster-slim
RUN apt-get update --quiet && \
apt-get install --quiet --yes --no-install-recommends \
gosu \
tini && \
gosu && \
rm -rf /var/lib/apt/lists/* && \
mkdir -p /rs/db
COPY --from=builder /rs/target/release/pastebin /rs/pastebin
COPY entrypoint.sh /rs/entrypoint.sh
WORKDIR /rs
ENTRYPOINT ["tini", "--"]
CMD ["/bin/sh", "/rs/entrypoint.sh"]

View File

@ -1,7 +1,7 @@
version: "3"
services:
laverna:
pastebin:
networks:
- proxy
labels:

View File

@ -5,5 +5,6 @@ services:
image: atareao/pastebin:v1.0
container_name: pastebin
restart: unless-stopped
init: true
volumes:
- ./db:/rs/db

View File

@ -24,10 +24,12 @@
USER_ID=${LOCAL_UID:-1000}
GROUP_ID=${LOCAL_GID:-1000}
echo "Starting with UID: $USER_ID, GID: $GROUP_ID"
useradd -u "$USER_ID" -o -m dockerus
groupmod -g "$GROUP_ID" dockerus
export HOME=/home/dockerus
if ! id dockerus &>/dev/null; then
echo "Starting with UID: $USER_ID, GID: $GROUP_ID"
useradd --uid "$USER_ID" --non-unique dockerus
groupmod --gid "$GROUP_ID" dockerus
echo "User created"
fi
chown -R dockerus:dockerus /rs