Hotfix: Dockerfile log file perm
This commit is contained in:
24
Dockerfile
24
Dockerfile
@@ -5,21 +5,19 @@ ARG BUILDPLATFORM
|
|||||||
ARG VERSION
|
ARG VERSION
|
||||||
ARG CHANNEL
|
ARG CHANNEL
|
||||||
|
|
||||||
# Set destination for COPY
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Download Go modules
|
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
|
||||||
# Copy the source code. Note the slash at the end, as explained in
|
|
||||||
# https://docs.docker.com/reference/dockerfile/#copy
|
|
||||||
ADD . .
|
ADD . .
|
||||||
|
|
||||||
# Build
|
RUN CGO_ENABLED=0 GOOS=$(echo $TARGETPLATFORM | cut -d '/' -f1) GOARCH=$(echo $TARGETPLATFORM | cut -d '/' -f2) go build \
|
||||||
RUN CGO_ENABLED=0 GOOS=$(echo $TARGETPLATFORM | cut -d '/' -f1) GOARCH=$(echo $TARGETPLATFORM | cut -d '/' -f2) go build -ldflags="-X github.com/sirrobot01/debrid-blackhole/pkg/version.Version=${VERSION} -X github.com/sirrobot01/debrid-blackhole/pkg/version.Channel=${CHANNEL}" -o /blackhole
|
-ldflags="-X github.com/sirrobot01/debrid-blackhole/pkg/version.Version=${VERSION} -X github.com/sirrobot01/debrid-blackhole/pkg/version.Channel=${CHANNEL}" \
|
||||||
|
-o /blackhole
|
||||||
|
|
||||||
RUN CGO_ENABLED=0 GOOS=$(echo $TARGETPLATFORM | cut -d '/' -f1) GOARCH=$(echo $TARGETPLATFORM | cut -d '/' -f2) go build -o /healthcheck cmd/healthcheck/main.go
|
RUN CGO_ENABLED=0 GOOS=$(echo $TARGETPLATFORM | cut -d '/' -f1) GOARCH=$(echo $TARGETPLATFORM | cut -d '/' -f2) go build \
|
||||||
|
-o /healthcheck cmd/healthcheck/main.go
|
||||||
|
|
||||||
FROM alpine as logsetup
|
FROM alpine as logsetup
|
||||||
ARG PUID=1000
|
ARG PUID=1000
|
||||||
@@ -27,19 +25,16 @@ ARG PGID=1000
|
|||||||
RUN addgroup -g $PGID appuser && \
|
RUN addgroup -g $PGID appuser && \
|
||||||
adduser -D -u $PUID -G appuser appuser && \
|
adduser -D -u $PUID -G appuser appuser && \
|
||||||
mkdir -p /logs && \
|
mkdir -p /logs && \
|
||||||
chown -R appuser:appuser /logs && \
|
chmod 777 /logs && \
|
||||||
mkdir -p /app && \
|
touch /logs/decypharr.log && \
|
||||||
chown appuser:appuser /app
|
chmod 666 /logs/decypharr.log
|
||||||
|
|
||||||
FROM gcr.io/distroless/static-debian12:latest
|
FROM gcr.io/distroless/static-debian12:latest
|
||||||
COPY --from=builder /blackhole /blackhole
|
COPY --from=builder /blackhole /blackhole
|
||||||
COPY --from=builder /healthcheck /healthcheck
|
COPY --from=builder /healthcheck /healthcheck
|
||||||
COPY --from=builder /app/README.md /README.md
|
|
||||||
COPY --from=logsetup /etc/passwd /etc/passwd
|
COPY --from=logsetup /etc/passwd /etc/passwd
|
||||||
COPY --from=logsetup /etc/group /etc/group
|
COPY --from=logsetup /etc/group /etc/group
|
||||||
COPY --from=logsetup /logs /logs
|
COPY --from=logsetup /logs /logs
|
||||||
COPY --from=logsetup /app /app
|
|
||||||
|
|
||||||
|
|
||||||
ENV LOG_PATH=/logs
|
ENV LOG_PATH=/logs
|
||||||
|
|
||||||
@@ -51,5 +46,4 @@ USER appuser
|
|||||||
|
|
||||||
HEALTHCHECK CMD ["/healthcheck"]
|
HEALTHCHECK CMD ["/healthcheck"]
|
||||||
|
|
||||||
# Run
|
CMD ["/blackhole", "--config", "/app/config.json"]
|
||||||
CMD ["/blackhole", "--config", "/app/config.json"]
|
|
||||||
@@ -113,7 +113,6 @@ func (u *uiHandler) ConfigHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *uiHandler) handleGetArrs(w http.ResponseWriter, r *http.Request) {
|
func (u *uiHandler) handleGetArrs(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Content-Type", "application/json")
|
|
||||||
common.JSONResponse(w, u.qbit.Arrs.GetAll(), http.StatusOK)
|
common.JSONResponse(w, u.qbit.Arrs.GetAll(), http.StatusOK)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,7 +160,6 @@ func (u *uiHandler) handleAddContent(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *uiHandler) handleCheckCached(w http.ResponseWriter, r *http.Request) {
|
func (u *uiHandler) handleCheckCached(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Content-Type", "application/json")
|
|
||||||
_hashes := r.URL.Query().Get("hash")
|
_hashes := r.URL.Query().Get("hash")
|
||||||
if _hashes == "" {
|
if _hashes == "" {
|
||||||
http.Error(w, "No hashes provided", http.StatusBadRequest)
|
http.Error(w, "No hashes provided", http.StatusBadRequest)
|
||||||
@@ -242,12 +240,10 @@ func (u *uiHandler) handleRepairMedia(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
func (u *uiHandler) handleGetVersion(w http.ResponseWriter, r *http.Request) {
|
func (u *uiHandler) handleGetVersion(w http.ResponseWriter, r *http.Request) {
|
||||||
v := version.GetInfo()
|
v := version.GetInfo()
|
||||||
w.Header().Set("Content-Type", "application/json")
|
|
||||||
common.JSONResponse(w, v, http.StatusOK)
|
common.JSONResponse(w, v, http.StatusOK)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *uiHandler) handleGetTorrents(w http.ResponseWriter, r *http.Request) {
|
func (u *uiHandler) handleGetTorrents(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Content-Type", "application/json")
|
|
||||||
common.JSONResponse(w, u.qbit.Storage.GetAll("", "", nil), http.StatusOK)
|
common.JSONResponse(w, u.qbit.Storage.GetAll("", "", nil), http.StatusOK)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,7 +258,6 @@ func (u *uiHandler) handleDeleteTorrent(w http.ResponseWriter, r *http.Request)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *uiHandler) handleGetConfig(w http.ResponseWriter, r *http.Request) {
|
func (u *uiHandler) handleGetConfig(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Header().Set("Content-Type", "application/json")
|
|
||||||
config := common.CONFIG
|
config := common.CONFIG
|
||||||
arrCfgs := make([]common.ArrConfig, 0)
|
arrCfgs := make([]common.ArrConfig, 0)
|
||||||
for _, a := range u.qbit.Arrs.GetAll() {
|
for _, a := range u.qbit.Arrs.GetAll() {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ func NewQBit(config *common.Config, deb *debrid.DebridService, logger zerolog.Lo
|
|||||||
DownloadFolder: cfg.DownloadFolder,
|
DownloadFolder: cfg.DownloadFolder,
|
||||||
Categories: cfg.Categories,
|
Categories: cfg.Categories,
|
||||||
Debrid: deb,
|
Debrid: deb,
|
||||||
Storage: NewTorrentStorage("torrents.json"),
|
Storage: NewTorrentStorage("/app/torrents.json"),
|
||||||
logger: logger,
|
logger: logger,
|
||||||
Arrs: arrs,
|
Arrs: arrs,
|
||||||
RefreshInterval: refreshInterval,
|
RefreshInterval: refreshInterval,
|
||||||
|
|||||||
Reference in New Issue
Block a user