mirror of
https://github.com/codex-storage/nim-codex.git
synced 2025-01-09 12:35:51 +00:00
750fe2392f
* Adds option to automatically announce codex by its public IP * Review comments by Slava * Make NAT_PUBLIC_IP_AUTO more verbose and error resistant Signed-off-by: Slava <20563034+veaceslavdoina@users.noreply.github.com> --------- Signed-off-by: Slava <20563034+veaceslavdoina@users.noreply.github.com> Co-authored-by: Slava <20563034+veaceslavdoina@users.noreply.github.com>
39 lines
1.0 KiB
Docker
39 lines
1.0 KiB
Docker
# Variables
|
|
ARG BUILDER=ubuntu:lunar-20230415
|
|
ARG IMAGE=${BUILDER}
|
|
ARG BUILD_HOME=/src
|
|
ARG MAKE_PARALLEL=${MAKE_PARALLEL:-4}
|
|
ARG NIMFLAGS="${NIMFLAGS:-"-d:disableMarchNative"}"
|
|
ARG APP_HOME=/codex
|
|
ARG NAT_IP_AUTO=${NAT_IP_AUTO:-false}
|
|
|
|
# Build
|
|
FROM ${BUILDER} AS builder
|
|
ARG BUILD_HOME
|
|
ARG MAKE_PARALLEL
|
|
ARG NIMFLAGS
|
|
|
|
RUN apt-get update && apt-get install -y git cmake curl make bash lcov build-essential nim
|
|
RUN echo 'export NIMBLE_DIR="${HOME}/.nimble"' >> "${HOME}/.bash_env"
|
|
RUN echo 'export PATH="${NIMBLE_DIR}/bin:${PATH}"' >> "${HOME}/.bash_env"
|
|
|
|
WORKDIR ${BUILD_HOME}
|
|
COPY . .
|
|
RUN make clean
|
|
RUN make -j ${MAKE_PARALLEL} update
|
|
RUN make -j ${MAKE_PARALLEL}
|
|
|
|
# Create
|
|
FROM ${IMAGE}
|
|
ARG BUILD_HOME
|
|
ARG APP_HOME
|
|
ARG NAT_IP_AUTO
|
|
|
|
WORKDIR ${APP_HOME}
|
|
COPY --from=builder ${BUILD_HOME}/build/codex /usr/local/bin
|
|
COPY --chmod=0755 docker/docker-entrypoint.sh /
|
|
RUN apt-get update && apt-get install -y libgomp1 bash curl && rm -rf /var/lib/apt/lists/*
|
|
ENV NAT_IP_AUTO=${NAT_IP_AUTO}
|
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
|
CMD ["codex"]
|