2024-01-04 05:11:46 +01:00
|
|
|
FROM alpine:3.19 AS build
|
2023-04-04 15:17:55 +02:00
|
|
|
|
|
|
|
RUN apk update && \
|
|
|
|
apk add --no-cache \
|
|
|
|
make \
|
|
|
|
gcc \
|
|
|
|
musl-dev \
|
|
|
|
libstdc++
|
|
|
|
|
2024-01-04 05:11:46 +01:00
|
|
|
COPY --from=golang:1.21-alpine /usr/local/go/ /usr/local/go/
|
2023-04-04 15:17:55 +02:00
|
|
|
ENV PATH="/usr/local/go/bin:${PATH}"
|
|
|
|
|
2024-01-04 05:11:46 +01:00
|
|
|
COPY --from=node:20-alpine /usr/local/ /usr/local/
|
2023-04-04 15:17:55 +02:00
|
|
|
ENV NODE_PATH="/usr/local/lib/node_modules"
|
|
|
|
ENV PATH="/usr/local/bin:${PATH}"
|
|
|
|
|
|
|
|
WORKDIR /opengist
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN make
|
|
|
|
|
|
|
|
|
2024-01-04 05:11:46 +01:00
|
|
|
FROM alpine:3.19 as run
|
2023-04-04 15:17:55 +02:00
|
|
|
|
2023-04-10 22:52:52 +02:00
|
|
|
RUN apk update && \
|
|
|
|
apk add --no-cache \
|
2023-06-18 12:50:36 +02:00
|
|
|
shadow \
|
2023-04-10 22:52:52 +02:00
|
|
|
openssl \
|
|
|
|
openssh \
|
|
|
|
curl \
|
|
|
|
wget \
|
|
|
|
git \
|
|
|
|
gnupg \
|
|
|
|
xz \
|
|
|
|
gcc \
|
|
|
|
musl-dev \
|
|
|
|
libstdc++
|
|
|
|
|
2023-06-18 12:50:36 +02:00
|
|
|
RUN addgroup -S opengist && \
|
|
|
|
adduser -S -G opengist -H -s /bin/ash -g 'Opengist User' opengist
|
|
|
|
|
2023-10-15 08:14:34 +02:00
|
|
|
COPY --from=build --chown=opengist:opengist /opengist/config.yml config.yml
|
|
|
|
|
2023-06-18 12:50:36 +02:00
|
|
|
WORKDIR /app/opengist
|
2023-04-10 22:52:52 +02:00
|
|
|
|
2023-06-18 12:50:36 +02:00
|
|
|
COPY --from=build --chown=opengist:opengist /opengist/opengist .
|
|
|
|
COPY --from=build --chown=opengist:opengist /opengist/docker ./docker
|
2023-04-10 22:52:52 +02:00
|
|
|
|
|
|
|
EXPOSE 6157 2222
|
2023-06-18 12:50:36 +02:00
|
|
|
VOLUME /opengist
|
2024-01-05 22:29:01 +01:00
|
|
|
HEALTHCHECK --interval=60s --timeout=30s --start-period=15s --retries=3 CMD curl -f http://localhost:6157/healthcheck || exit 1
|
2023-06-18 12:50:36 +02:00
|
|
|
ENTRYPOINT ["./docker/entrypoint.sh"]
|