2021-06-09 15:24:52 +02:00
|
|
|
## build ergo binary
|
2023-08-16 02:37:58 +02:00
|
|
|
FROM golang:1.21-alpine AS build-env
|
2019-11-22 18:48:53 +01:00
|
|
|
|
2023-06-03 01:12:50 +02:00
|
|
|
RUN apk upgrade -U --force-refresh --no-cache && apk add --no-cache --purge --clean-protected -l -u make git
|
2019-11-22 18:48:53 +01:00
|
|
|
|
2021-06-09 15:24:52 +02:00
|
|
|
# copy ergo source
|
2021-05-28 22:49:14 +02:00
|
|
|
WORKDIR /go/src/github.com/ergochat/ergo
|
2021-06-09 15:24:52 +02:00
|
|
|
COPY . .
|
2019-11-22 18:48:53 +01:00
|
|
|
|
2020-03-08 05:49:59 +01:00
|
|
|
# modify default config file so that it doesn't die on IPv6
|
|
|
|
# and so it can be exposed via 6667 by default
|
2021-06-09 15:24:52 +02:00
|
|
|
RUN sed -i 's/^\(\s*\)\"127.0.0.1:6667\":.*$/\1":6667":/' /go/src/github.com/ergochat/ergo/default.yaml && \
|
|
|
|
sed -i 's/^\s*\"\[::1\]:6667\":.*$//' /go/src/github.com/ergochat/ergo/default.yaml
|
2020-03-08 05:49:59 +01:00
|
|
|
|
2019-11-22 18:48:53 +01:00
|
|
|
# compile
|
2023-02-12 03:55:57 +01:00
|
|
|
RUN make install
|
2019-11-22 18:48:53 +01:00
|
|
|
|
2021-06-09 15:24:52 +02:00
|
|
|
## build ergo container
|
|
|
|
FROM alpine:3.13
|
2019-11-22 18:48:53 +01:00
|
|
|
|
|
|
|
# metadata
|
2021-06-09 15:24:52 +02:00
|
|
|
LABEL maintainer="Daniel Oaks <daniel@danieloaks.net>,Daniel Thamdrup <dallemon@protonmail.com>" \
|
|
|
|
description="Ergo is a modern, experimental IRC server written in Go"
|
2019-11-22 18:48:53 +01:00
|
|
|
|
|
|
|
# standard ports listened on
|
|
|
|
EXPOSE 6667/tcp 6697/tcp
|
|
|
|
|
2021-06-09 15:24:52 +02:00
|
|
|
# ergo itself
|
|
|
|
COPY --from=build-env /go/bin/ergo \
|
|
|
|
/go/src/github.com/ergochat/ergo/default.yaml \
|
|
|
|
/go/src/github.com/ergochat/ergo/distrib/docker/run.sh \
|
|
|
|
/ircd-bin/
|
2021-05-28 22:49:14 +02:00
|
|
|
COPY --from=build-env /go/src/github.com/ergochat/ergo/languages /ircd-bin/languages/
|
2019-11-22 18:48:53 +01:00
|
|
|
|
|
|
|
# running volume holding config file, db, certs
|
|
|
|
VOLUME /ircd
|
|
|
|
WORKDIR /ircd
|
|
|
|
|
|
|
|
# default motd
|
2021-05-28 22:49:14 +02:00
|
|
|
COPY --from=build-env /go/src/github.com/ergochat/ergo/ergo.motd /ircd/ergo.motd
|
2019-11-22 18:48:53 +01:00
|
|
|
|
|
|
|
# launch
|
|
|
|
ENTRYPOINT ["/ircd-bin/run.sh"]
|
|
|
|
|
|
|
|
# # uncomment to debug
|
|
|
|
# RUN apk add --no-cache bash
|
|
|
|
# RUN apk add --no-cache vim
|
|
|
|
# CMD /bin/bash
|