Browse Source

Initial insert

main
Aaron Fischer 5 months ago
commit
856d524707
  1. 35
      Dockerfile
  2. 7
      docker-compose.yml
  3. 11
      localhost.cnf
  4. 15
      twins.ini

35
Dockerfile

@ -0,0 +1,35 @@
# Twins, a simple gemini server and reverse proxy
# @Author Twins: Trevor Slocum
# @Author Docker build: Aaron Fischer
# Build
FROM golang:1.16-alpine AS builder
RUN apk add --no-cache openssl
RUN go get -v code.rocketnine.space/tslocum/twins
COPY ./localhost.cnf /build/localhost.cnf
RUN openssl req \
-x509 \
-out /build/localhost.crt \
-keyout /build/localhost.key \
-newkey rsa:2048 \
-nodes \
-sha256 \
-subj '/CN=localhost' \
-extensions EXT \
-config /build/localhost.cnf
# Compress
FROM gruebel/upx:latest as upx
COPY --from=builder /go/bin/twins /app.org
RUN upx --best --lzma -o /app /app.org
# Final image
FROM alpine:3.13
WORKDIR /app
COPY --from=upx /app /app/twins
COPY ./twins.ini /app/config/twins.ini
COPY --from=builder /build/localhost.crt /app/certs/localhost.crt
COPY --from=builder /build/localhost.key /app/certs/localhost.key
EXPOSE 1965
CMD ["/app/twins", "-config", "/app/config/twins.ini"]

7
docker-compose.yml

@ -0,0 +1,7 @@
version: "3"
services:
twins:
build: .
ports:
- 1965:1965

11
localhost.cnf

@ -0,0 +1,11 @@
[dn]
CN=localhost
[req]
distinguished_name = dn
[EXT]
subjectAltName=DNS:localhost
keyUsage=digitalSignature
extendedKeyUsage=serverAuth

15
twins.ini

@ -0,0 +1,15 @@
listen: :1965
disablehttps: true
disablesize: true
hosts:
default:
paths:
- lang: en
symlinks: false
localhost:
cert: /app/certs/localhost.crt
key: /app/certs/localhost.key
paths:
- path: /
command: echo "Welcome to twins"
Loading…
Cancel
Save