2023-12-21 16:04:04 +00:00
|
|
|
#
|
|
|
|
# Build image
|
|
|
|
#
|
2024-12-21 14:02:24 +00:00
|
|
|
FROM alpine:3.21 AS builder
|
2023-12-21 16:04:04 +00:00
|
|
|
LABEL maintainer="Varakh <varakh@varakh.de>"
|
|
|
|
|
|
|
|
RUN apk --update upgrade && \
|
2024-12-21 14:02:24 +00:00
|
|
|
apk add go gcc make && \
|
2024-10-25 14:12:35 +00:00
|
|
|
apk add nodejs npm && \
|
2023-12-21 16:04:04 +00:00
|
|
|
# See https://stackoverflow.com/questions/34729748/installed-go-binary-not-found-in-path-on-alpine-linux-docker
|
|
|
|
mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 && \
|
|
|
|
rm -rf /var/cache/apk/*
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
2024-12-11 08:19:36 +00:00
|
|
|
RUN npm install --global pnpm@^9 && \
|
2023-12-21 16:04:04 +00:00
|
|
|
CC=gcc make ci
|
|
|
|
|
|
|
|
#
|
|
|
|
# Actual image
|
|
|
|
#
|
2024-12-21 14:02:24 +00:00
|
|
|
FROM alpine:3.21
|
2023-12-21 16:04:04 +00:00
|
|
|
LABEL maintainer="Varakh <varakh@varakh.de>" \
|
|
|
|
description="upda" \
|
|
|
|
org.opencontainers.image.authors="Varakh" \
|
|
|
|
org.opencontainers.image.vendor="Varakh" \
|
|
|
|
org.opencontainers.image.title="upda" \
|
|
|
|
org.opencontainers.image.description="upda" \
|
2024-12-21 14:02:24 +00:00
|
|
|
org.opencontainers.image.base.name="alpine:3.21"
|
2023-12-21 16:04:04 +00:00
|
|
|
|
2024-12-12 07:46:33 +00:00
|
|
|
ENV USER=appuser
|
|
|
|
ENV GROUP=appuser
|
|
|
|
ENV UID=2033
|
|
|
|
ENV GID=2033
|
2023-12-21 16:04:04 +00:00
|
|
|
|
|
|
|
RUN apk --update upgrade && \
|
2024-12-21 14:02:24 +00:00
|
|
|
apk add tzdata && \
|
2023-12-21 16:04:04 +00:00
|
|
|
rm -rf /var/cache/apk/* && \
|
|
|
|
addgroup -S ${GROUP} -g ${GID} && \
|
|
|
|
adduser -S ${USER} -G ${GROUP} -u ${UID}
|
|
|
|
|
|
|
|
COPY --from=builder /app/bin/upda-cli-linux-amd64 /usr/bin/upda-cli
|
|
|
|
COPY --from=builder /app/bin/upda-server-linux-amd64 /usr/bin/upda-server
|
|
|
|
|
|
|
|
USER ${USER}
|
|
|
|
|
2024-12-12 07:46:33 +00:00
|
|
|
ENV SERVER_PORT=8080
|
2023-12-21 16:04:04 +00:00
|
|
|
EXPOSE ${SERVER_PORT}
|
|
|
|
CMD ["/usr/bin/upda-server"]
|