-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.sqlite-web
More file actions
41 lines (27 loc) · 1013 Bytes
/
Dockerfile.sqlite-web
File metadata and controls
41 lines (27 loc) · 1013 Bytes
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
FROM golang:1.24.5-alpine3.22 AS backend
WORKDIR /app
COPY /sqlite-web /app/sqlite-web
COPY /global-go/utils /app/global-go/utils
WORKDIR /app/sqlite-web
RUN go env -w GOCACHE=/go-cache
RUN go mod download && go mod verify
RUN --mount=type=cache,target=/go-cache \
go build -o /app/sqlite-web/out_exe .
FROM alpine:3.20 AS runner
RUN apk add python3~=3.12
WORKDIR /app
COPY --from=backend /app/sqlite-web/out_exe /app/sqlite-web
COPY --from=backend /app/sqlite-web/backup.py /app/backup.py
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
COPY /sqlite-web/manual-backup.sh /app/manual-backup.sh
RUN chmod a+x /app/manual-backup.sh
ARG USER_ID=4242
ARG GROUP_ID=4242
ARG DOCKER_USER=hxi2dbadmin
RUN addgroup -g $GROUP_ID -S $DOCKER_USER && adduser -D -u $USER_ID -G $DOCKER_USER -S $DOCKER_USER
RUN chown -R $DOCKER_USER:$DOCKER_USER /app
USER $DOCKER_USER
ENV PATH=/home/$DOCKER_USER/.local/bin:$PATH
RUN uv tool install sqlite-web
RUN uv run /app/backup.py --help
CMD ["/app/sqlite-web"]