Add container usage

This commit is contained in:
Felix Niederwanger 2022-02-05 12:06:42 +01:00
parent 80f7d4bb51
commit 5400abb1b1
Signed by: phoenix
GPG key ID: 6E77A590E3F6D71C
3 changed files with 37 additions and 0 deletions

12
Dockerfile Normal file
View file

@ -0,0 +1,12 @@
FROM golang:alpine AS builder
WORKDIR /app
ADD . /app
RUN apk update && apk add build-base
RUN cd /app && GOARGS="-buildmode=pie" CGO_ENABLED=0 make orion -B
FROM scratch
WORKDIR /data
COPY --from=builder /app/orion /bin/orion
ENTRYPOINT ["/bin/orion", "-config", "/conf/orion.conf"]
VOLUME ["/conf"]
VOLUME ["/data"]

View file

@ -8,3 +8,9 @@ orion: cmd/orion/orion.go cmd/orion/gemini.go cmd/orion/config.go
cert:
openssl genrsa -out orion.key 2048
openssl req -x509 -nodes -days 3650 -key orion.key -out orion.crt
# Container recipies
docker:
docker build . -t feldspaten.org/orion
podman:
podman build . -t feldspaten.org/orion

View file

@ -20,6 +20,25 @@ To create self-signed certificates for quick testing, you can use the following
make cert
### podman/docker container
`orion` is able to launch from a podman/docker container, however you need to first build the container yourself.
make podman # Build container for podman
make docker # Build container for docker
The container expects the `/conf` volume to contain your configuration file `orion.conf` and suggests to place your date into the `/data` volume. If you want to use the later depends on your configuration in `orion.conf`.
After building and configuration, this is how you can run your container:
# Replace `podman` with `docker` for a docker container
podman run --rm -ti --name orion -v /srv/orion/conf:/conf -v /srv/orion/data/:/data -p 1965 feldspaten.org/orion
It's recommended to place your certificates in the `/conf` direcory and use the following configuration
Certfile = /conf/orion.crt
Keyfile = /conf/orion.key
## Credits
* This project was inspired by the [titan2](https://gitlab.com/lostleonardo/titan2) minimalistic Gemini server written by lostleonardo.