opengist/Dockerfile

51 lines
928 B
Text
Raw Normal View History

FROM alpine:3.17 AS build
2023-04-04 13:17:55 +00:00
RUN apk update && \
apk add --no-cache \
make \
gcc \
musl-dev \
libstdc++
2023-09-18 16:17:11 +00:00
COPY --from=golang:1.20-alpine /usr/local/go/ /usr/local/go/
2023-04-04 13:17:55 +00:00
ENV PATH="/usr/local/go/bin:${PATH}"
2023-04-07 08:32:03 +00:00
COPY --from=node:18-alpine /usr/local/ /usr/local/
2023-04-04 13:17:55 +00:00
ENV NODE_PATH="/usr/local/lib/node_modules"
ENV PATH="/usr/local/bin:${PATH}"
WORKDIR /opengist
COPY . .
RUN make
2023-06-18 10:50:36 +00:00
FROM alpine:3.17 as run
2023-04-04 13:17:55 +00:00
RUN apk update && \
apk add --no-cache \
2023-06-18 10:50:36 +00:00
shadow \
openssl \
openssh \
curl \
wget \
git \
gnupg \
xz \
gcc \
musl-dev \
libstdc++
2023-06-18 10:50:36 +00:00
RUN addgroup -S opengist && \
adduser -S -G opengist -H -s /bin/ash -g 'Opengist User' opengist
WORKDIR /app/opengist
2023-06-18 10:50:36 +00:00
COPY --from=build --chown=opengist:opengist /opengist/opengist .
COPY --from=build --chown=opengist:opengist /opengist/docker ./docker
EXPOSE 6157 2222
2023-06-18 10:50:36 +00:00
VOLUME /opengist
ENTRYPOINT ["./docker/entrypoint.sh"]