You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
986 B

3 years ago
  1. # Build go-neb
  2. FROM golang:1.18-alpine as builder
  3. RUN apk add --no-cache -t build-deps git gcc musl-dev go make g++
  4. RUN git clone https://gitlab.matrix.org/matrix-org/olm.git /tmp/libolm \
  5. && cd /tmp/libolm \
  6. && make install
  7. COPY . /tmp/go-neb
  8. WORKDIR /tmp/go-neb
  9. RUN go install honnef.co/go/tools/cmd/staticcheck@latest \
  10. && go install github.com/fzipp/gocyclo/cmd/gocyclo@latest \
  11. && go build github.com/matrix-org/go-neb
  12. # Ensures we're lint-free
  13. RUN /tmp/go-neb/hooks/pre-commit
  14. # Run go-neb
  15. FROM alpine:3.13
  16. ENV BIND_ADDRESS=:4050 \
  17. DATABASE_TYPE=sqlite3 \
  18. DATABASE_URL=/data/go-neb.db?_busy_timeout=5000 \
  19. UID=1337 \
  20. GID=1337
  21. COPY --from=builder /tmp/go-neb/go-neb /usr/local/bin/go-neb
  22. # Copy libolm.so
  23. COPY --from=builder /usr/local/lib/* /usr/local/lib/
  24. RUN apk add --no-cache \
  25. libstdc++ \
  26. ca-certificates \
  27. su-exec \
  28. s6
  29. VOLUME /data
  30. EXPOSE 4050
  31. COPY docker/root /
  32. ENTRYPOINT ["/bin/s6-svscan", "/etc/s6.d/"]