Initial insert
This commit is contained in:
commit
856d524707
|
@ -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"]
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
twins:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- 1965:1965
|
|
@ -0,0 +1,11 @@
|
||||||
|
[dn]
|
||||||
|
CN=localhost
|
||||||
|
|
||||||
|
[req]
|
||||||
|
distinguished_name = dn
|
||||||
|
|
||||||
|
[EXT]
|
||||||
|
subjectAltName=DNS:localhost
|
||||||
|
keyUsage=digitalSignature
|
||||||
|
extendedKeyUsage=serverAuth
|
||||||
|
|
Loading…
Reference in New Issue