reorg dir structure, add docker image build

This commit is contained in:
2023-03-17 19:16:06 +01:00
parent f5e0284c40
commit b3a2be534e
23 changed files with 107 additions and 154 deletions

33
Dockerfile Normal file
View File

@@ -0,0 +1,33 @@
# syntax=docker/dockerfile:1 -*-python-*-
FROM golang:1.20-alpine as builder
RUN apk update
RUN apk upgrade
RUN apk add --no-cache git make bash binutils
RUN git --version
WORKDIR /work
COPY go.mod .
RUN go mod download
COPY . .
RUN make && strip upd
FROM alpine:3.17
LABEL maintainer="Uploads Author <info@daemon.de>"
RUN install -o 1001 -g 1001 -d /data
WORKDIR /app
COPY --from=builder /work/upd /app/upd
ENV UPD_LISTEN=:8080
ENV UPD_STORAGEDIR=/data
ENV UPD_DBFILE=/data/bbolt.db
ENV UPD_DEBUG=1
USER 1001:1001
EXPOSE 8080
VOLUME /data
CMD ["/app/upd"]