commit
3fd313f2f5
@ -0,0 +1,9 @@ |
||||
# Global Settings |
||||
LOCAL_STACK_DIR=/srv/docker/volumes/ircd |
||||
|
||||
# Catbox (optional) |
||||
CTB_CONTAINER_NAME= |
||||
CTB_RESTART= |
||||
|
||||
CTB_BLD_REPO= |
||||
CTB_BLD_VER= |
@ -0,0 +1 @@ |
||||
*.env |
@ -0,0 +1,43 @@ |
||||
FROM golang:alpine AS build |
||||
|
||||
ARG BLD_REPO=${BLD_REPO:-https://github.com/horgh/catbox.git} |
||||
ARG BLD_VER=${BLD_VER:-master} |
||||
|
||||
ARG GOOS |
||||
ARG GOARCH |
||||
|
||||
RUN apk --update add \ |
||||
git |
||||
|
||||
RUN git clone \ |
||||
--depth 1 \ |
||||
--single-branch \ |
||||
--branch ${BLD_VER} \ |
||||
${BLD_REPO} \ |
||||
/srv/src/catbox |
||||
|
||||
WORKDIR /srv/src/catbox |
||||
|
||||
RUN GOOS=${GOOS} \ |
||||
GOARCH=${GOARCH} \ |
||||
CGO_ENABLED=0 \ |
||||
go build \ |
||||
--installsuffix cgo \ |
||||
--ldflags "-w -s" \ |
||||
-o "/srv/dist/catbox" \ |
||||
. |
||||
|
||||
RUN cp -r /srv/src/catbox/conf /srv/dist/conf && \ |
||||
sed -i 's|#opers-config =|opers-config = /srv/data/conf/opers.conf|g' /srv/dist/conf/catbox.conf && \ |
||||
sed -i 's|#servers-config =|servers-config = /srv/data/conf/servers.conf|g' /srv/dist/conf/catbox.conf && \ |
||||
sed -i 's|#users-config =|users-config = /srv/data/conf/users.conf|g' /srv/dist/conf/catbox.conf |
||||
|
||||
FROM alpine:latest |
||||
|
||||
RUN adduser -D catbox |
||||
|
||||
COPY --from=build --chown=catbox /srv/dist /srv/catbox |
||||
|
||||
COPY root/ / |
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"] |
@ -0,0 +1,9 @@ |
||||
#!/bin/sh |
||||
|
||||
mkdir -p /srv/data |
||||
|
||||
cp --no-clobber -p -r /srv/catbox/conf /srv/data/ |
||||
|
||||
su catbox \ |
||||
-c "/srv/catbox/catbox \ |
||||
-conf /srv/data/conf/catbox.conf" |
@ -0,0 +1,15 @@ |
||||
version: "3" |
||||
|
||||
services: |
||||
catbox: |
||||
build: |
||||
context: catbox/ |
||||
args: |
||||
- BLD_REPO=${CTB_BLD_REPO:-https://github.com/horgh/catbox.git} |
||||
- BLD_VER=${CTB_BLD_VER:-master} |
||||
container_name: ${CTB_CONTAINER_NAME:-ircd-catbox} |
||||
restart: ${CTB_RESTART:-unless-stopped} |
||||
volumes: |
||||
- ${LOCAL_STACK_DIR:-/srv/docker/volumes/ircd}/catbox/data:/srv/data |
||||
ports: |
||||
- 6667:6667 |
Loading…
Reference in new issue