Browse Source

dockerization

master v0.1.0
Jan Christian Grünhage 4 years ago
parent
commit
1e320a0683
  1. 1
      .dockerignore
  2. 7
      .drone.yml
  3. 22
      Dockerfile
  4. 4
      docker/root/etc/periodic/daily/roomnamebot
  5. 1
      docker/root/etc/s6.d/.s6-svscan/finish
  6. 2
      docker/root/etc/s6.d/cron/finish
  7. 2
      docker/root/etc/s6.d/cron/run

1
.dockerignore

@ -0,0 +1 @@ @@ -0,0 +1 @@
target

7
.drone.yml

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
pipeline:
docker:
image: docker.io/plugins/docker
repo: docker.jcg.re/roomnamebot
registry: docker.jcg.re
secrets: [ docker_username, docker_password ]
autotag: true

22
Dockerfile

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
FROM docker.io/alpine:edge as builder
COPY . /src
RUN apk add --no-cache \
cargo \
build-base \
openssl-dev \
&& cd /src \
&& cargo build --release
FROM docker.io/alpine:edge
ENV UID=1337 \
GID=1337
COPY --from=builder /src/target/release/roomnamebot /usr/local/bin/roomnamebot
RUN apk add --no-cache \
libssl1.0 \
libgcc \
ca-certificates \
s6 \
su-exec
COPY docker/root /
CMD ["/bin/s6-svscan", "/etc/s6.d/"]

4
docker/root/etc/periodic/daily/roomnamebot

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
#!/bin/sh
cd /data
chown -R ${UID}:${GID} .
exec su-exec ${UID}:${GID} roomnamebot

1
docker/root/etc/s6.d/.s6-svscan/finish

@ -0,0 +1 @@ @@ -0,0 +1 @@
#!/bin/sh

2
docker/root/etc/s6.d/cron/finish

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
#!/bin/sh
s6-svc -O /etc/s6.d/cron

2
docker/root/etc/s6.d/cron/run

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
#!/bin/sh
exec crond -f
Loading…
Cancel
Save