🐳 Add Dockerfile
This commit is contained in:
parent
5a8750e637
commit
43ddb362a9
|
@ -0,0 +1,22 @@
|
|||
FROM golang:1.15 AS builder
|
||||
|
||||
RUN mkdir /data && mkdir /data/shares
|
||||
|
||||
ADD . /src
|
||||
WORKDIR /src
|
||||
|
||||
ENV CGO_ENABLED=0
|
||||
|
||||
RUN go build .
|
||||
|
||||
# Actual image
|
||||
FROM scratch
|
||||
|
||||
ENV DATA_DIR=/data/shares
|
||||
ENV DATABASE=/data/ShareDAV.db
|
||||
|
||||
COPY --from=builder /src/ShareDAV /app/ShareDAV
|
||||
COPY --from=builder /data /data
|
||||
|
||||
ENTRYPOINT ["/app/ShareDAV"]
|
||||
CMD ["serve"]
|
4
main.go
4
main.go
|
@ -35,8 +35,8 @@ import (
|
|||
)
|
||||
|
||||
type config struct {
|
||||
DataDirectory string `name:"data-dir" default:"data" help:"Directory to store all files in."`
|
||||
Db string `name:"db" default:"ShareDAV.db" help:"Database file to use."`
|
||||
DataDirectory string `name:"data-dir" default:"data" help:"Directory to store all files in." env:"DATA_DIR"`
|
||||
Db string `name:"db" default:"ShareDAV.db" help:"Database file to use." env:"DATABASE"`
|
||||
}
|
||||
|
||||
type app struct {
|
||||
|
|
Loading…
Reference in New Issue