2021-05-28 22:49:14 +02:00
|
|
|
## build Ergo
|
2021-02-17 21:11:54 +01:00
|
|
|
FROM golang:1.16-alpine AS build-env
|
2019-11-22 18:48:53 +01:00
|
|
|
|
2020-03-08 05:49:59 +01:00
|
|
|
RUN apk add --no-cache git make curl sed
|
2019-11-22 18:48:53 +01:00
|
|
|
|
2021-05-28 22:49:14 +02:00
|
|
|
# copy ergo
|
|
|
|
RUN mkdir -p /go/src/github.com/ergochat/ergo
|
|
|
|
WORKDIR /go/src/github.com/ergochat/ergo
|
|
|
|
ADD . /go/src/github.com/ergochat/ergo/
|
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-05-28 22:49:14 +02:00
|
|
|
run sed -i 's/^\(\s*\)\"127.0.0.1:6667\":.*$/\1":6667":/' /go/src/github.com/ergochat/ergo/default.yaml
|
|
|
|
run 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
|
|
|
|
RUN make
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-28 22:49:14 +02:00
|
|
|
## run Ergo
|
2019-11-22 18:48:53 +01:00
|
|
|
FROM alpine:3.9
|
|
|
|
|
|
|
|
# metadata
|
|
|
|
LABEL maintainer="daniel@danieloaks.net"
|
2021-05-28 22:49:14 +02:00
|
|
|
LABEL description="Ergo is a modern, experimental IRC server written in Go"
|
2019-11-22 18:48:53 +01:00
|
|
|
|
|
|
|
# install latest updates and configure alpine
|
|
|
|
RUN apk update
|
|
|
|
RUN apk upgrade
|
|
|
|
RUN mkdir /lib/modules
|
|
|
|
|
|
|
|
# standard ports listened on
|
|
|
|
EXPOSE 6667/tcp 6697/tcp
|
|
|
|
|
|
|
|
# oragono itself
|
|
|
|
RUN mkdir -p /ircd-bin
|
2021-05-28 22:49:14 +02:00
|
|
|
COPY --from=build-env /go/bin/ergo /ircd-bin
|
|
|
|
COPY --from=build-env /go/src/github.com/ergochat/ergo/languages /ircd-bin/languages/
|
|
|
|
COPY --from=build-env /go/src/github.com/ergochat/ergo/default.yaml /ircd-bin/default.yaml
|
2020-03-07 10:02:33 +01:00
|
|
|
|
2019-11-22 18:48:53 +01:00
|
|
|
COPY distrib/docker/run.sh /ircd-bin/run.sh
|
|
|
|
RUN chmod +x /ircd-bin/run.sh
|
|
|
|
|
|
|
|
# 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
|