-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
50 lines (32 loc) · 1.38 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# build app
FROM golang:1.23-alpine3.20 AS app-builder
ARG VERSION=dev
ARG REVISION=dev
ARG BUILDTIME
RUN apk add --no-cache git make build-base
ENV SERVICE=omegabrr
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . ./
#ENV GOOS=linux
ENV CGO_ENABLED=0
RUN go build -ldflags "-s -w -X github.com/autobrr/omegabrr/internal/buildinfo.Version=${VERSION} -X github.com/autobrr/omegabrr/internal/buildinfo.Commit=${REVISION} -X github.com/autobrr/omegabrr/internal/buildinfo.Date=${BUILDTIME}" -o bin/omegabrr cmd/omegabrr/main.go
# build runner
FROM alpine:latest
LABEL org.opencontainers.image.source = "https://github.com/autobrr/omegabrr"
ENV APP_DIR="/app" CONFIG_DIR="/config" PUID="1000" PGID="1000" UMASK="002" TZ="Etc/UTC" ARGS=""
ENV XDG_CONFIG_HOME="${CONFIG_DIR}/.config" XDG_CACHE_HOME="${CONFIG_DIR}/.cache" XDG_DATA_HOME="${CONFIG_DIR}/.local/share" LANG="C.UTF-8" LC_ALL="C.UTF-8"
VOLUME ["${CONFIG_DIR}"]
# install packages
RUN apk add --no-cache tzdata shadow bash curl wget jq grep sed coreutils findutils unzip p7zip ca-certificates
COPY --from=app-builder /src/bin/omegabrr /usr/bin/
# make folders
RUN mkdir "${APP_DIR}" && \
# create user
useradd -u 1000 -U -d "${CONFIG_DIR}" -s /bin/false omegabrr && \
usermod -G users omegabrr
WORKDIR /config
EXPOSE 7441
ENTRYPOINT ["omegabrr", "run", "--config", "/config/config.yaml"]
#CMD ["--config", "/config"]