-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Thomas von Dein
committed
Dec 18, 2024
1 parent
83f8184
commit 4427f12
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM golang:1.21-alpine as builder | ||
|
||
RUN apk update | ||
RUN apk upgrade | ||
RUN apk add --no-cache git make | ||
|
||
RUN git --version | ||
|
||
WORKDIR /work | ||
|
||
COPY go.mod . | ||
COPY . . | ||
RUN go mod download | ||
RUN make | ||
|
||
FROM alpine:latest | ||
LABEL maintainer="Thomas von Dein <[email protected]>" | ||
|
||
WORKDIR /app | ||
COPY --from=builder /work/anydb /app/anydb | ||
|
||
ENV LANG C.UTF-8 | ||
USER 1001:1001 | ||
|
||
ENTRYPOINT ["/app/anydb"] | ||
CMD ["-h"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
version: "3.9" | ||
services: | ||
init: | ||
image: alpine:latest | ||
user: "root" | ||
group_add: | ||
- '${GROUP_ID}' | ||
volumes: | ||
- ${OUTDIR}:/backup | ||
command: chown -R ${USER_ID}:${USER_ID} /backup | ||
|
||
anydb: | ||
container_name: anydb | ||
user: "${USER_ID}:${USER_ID}" | ||
volumes: | ||
- ${OUTDIR}:/backup | ||
working_dir: /backup | ||
build: . | ||
image: anydb:latest | ||
depends_on: | ||
init: | ||
condition: service_completed_successfully |