-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (26 loc) · 1.07 KB
/
Dockerfile
File metadata and controls
36 lines (26 loc) · 1.07 KB
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
FROM golang:1.25-alpine AS builder
RUN apk --no-cache add ca-certificates tzdata git
RUN adduser -D -u 10001 appuser
WORKDIR /build
COPY . .
ARG TARGETOS=linux
ARG TARGETARCH=amd64
ARG VERSION=dev
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -mod=vendor -ldflags="-w -s -X main.version=${VERSION}" -o main
FROM alpine:3.19
# Install su-exec for user switching and shadow for usermod/groupmod
RUN apk --no-cache add ca-certificates tzdata su-exec shadow && \
mkdir -p /etc/anilist-mal-sync && \
adduser -D -u 10001 appuser && \
mkdir -p /home/appuser/.config/anilist-mal-sync && \
chown -R appuser:appuser /home/appuser
WORKDIR /app
COPY --from=builder /build/main ./main
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
LABEL org.opencontainers.image.source="https://github.com/bigspawn/anilist-mal-sync" \
org.opencontainers.image.description="Synchronization service for AniList and MyAnimeList" \
org.opencontainers.image.licenses="MIT"
EXPOSE 18080
ENTRYPOINT ["docker-entrypoint.sh"]
CMD []