Update Enigma BBS deployment
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled

This commit is contained in:
capitano
2026-04-07 16:35:44 +02:00
parent 6a39457989
commit 3089316a25
6 changed files with 197 additions and 77 deletions

View File

@@ -1,82 +1,70 @@
# Build stage
FROM --platform=${BUILDPLATFORM:-linux/amd64} node:20-bookworm-slim AS builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETOS
ENV NVM_DIR /root/.nvm \
DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y \
git curl build-essential python3 libssl-dev \
lrzsz arj lhasa unrar-free p7zip-full dos2unix \
&& npm set progress=false && npm config set depth 0 \
&& npm install -g npm@latest pm2
WORKDIR /tmp
RUN git clone --depth 1 https://github.com/NuSkooler/enigma-bbs.git enigma-bbs-source \
&& cd enigma-bbs-source \
&& npm install --ignore-scripts \
&& dos2unix docker/bin/docker-entrypoint.sh \
&& dos2unix autoexec.sh
# Runtime stage
FROM node:20-bookworm-slim
FROM --platform=${BUILDPLATFORM:-linux/amd64} node:20-bookworm-slim
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETOS
ARG TARGETBRANCH
LABEL maintainer="dave@force9.org"
ENV NVM_DIR=/root/.nvm \
DEBIAN_FRONTEND=noninteractive \
PATH=/root/.npm-global/bin:/usr/local/bin:/usr/bin:/bin \
BBS_ROOT_DIR=/enigma-bbs \
BBS_STAGING_PATH=/enigma-bbs-pre
ENV NVM_DIR /root/.nvm
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y \
git curl \
lrzsz arj lhasa unrar-free p7zip-full \
# Install APT and NPM packages
RUN apt-get update \
&& apt-get install -y \
git \
curl \
build-essential \
python3 \
libssl-dev \
lrzsz \
arj \
lhasa \
unrar-free \
p7zip-full \
dos2unix \
&& npm set progress=false && npm config set depth 0 \
&& npm install -g npm@latest \
&& npm install -g pm2
COPY . /enigma-bbs/
WORKDIR /enigma-bbs
# Install npm dependencies
RUN cd /enigma-bbs && npm install
# Prepare files
RUN dos2unix /enigma-bbs/docker/bin/docker-entrypoint.sh \
&& apt-get remove dos2unix -y \
&& chmod +x /enigma-bbs/docker/bin/docker-entrypoint.sh \
&& cp -f /enigma-bbs/docker/bin/sexyz /usr/local/bin \
&& mkdir -p /enigma-bbs-pre/art \
&& mkdir /enigma-bbs-pre/mods \
&& mkdir /enigma-bbs-pre/config \
&& cp -rp /enigma-bbs/art/* ../enigma-bbs-pre/art/ \
&& cp -rp /enigma-bbs/mods/* ../enigma-bbs-pre/mods/ \
&& cp -rp /enigma-bbs/config/* ../enigma-bbs-pre/config/ \
&& apt-get remove build-essential python3 libssl-dev git curl dos2unix -y \
&& apt-get autoremove -y \
&& npm set progress=false \
&& npm install -g pm2 \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& apt-get clean
WORKDIR /${BBS_ROOT_DIR}
COPY --from=builder /tmp/enigma-bbs-source/ ${BBS_ROOT_DIR}/
COPY --from=builder /usr/local/bin/sexyz /usr/local/bin/
RUN dos2unix ${BBS_ROOT_DIR}/docker/bin/docker-entrypoint.sh \
&& cp -f ${BBS_ROOT_DIR}/docker/bin/sexyz /usr/local/bin \
&& mkdir -p ${BBS_STAGING_PATH}/art \
&& mkdir -p ${BBS_STAGING_PATH}/mods \
&& mkdir -p ${BBS_STAGING_PATH}/config \
&& cp -rp ${BBS_ROOT_DIR}/art/* ${BBS_STAGING_PATH}/art/ \
&& cp -rp ${BBS_ROOT_DIR}/mods/* ${BBS_STAGING_PATH}/mods/ \
&& cp -rp ${BBS_ROOT_DIR}/config/* ${BBS_STAGING_PATH}/config/ \
&& rm -rf ${BBS_ROOT_DIR}/art/* \
&& rm -rf ${BBS_ROOT_DIR}/mods/* \
&& rm -rf ${BBS_ROOT_DIR}/config \
&& ln -s ${BBS_STAGING_PATH}/config ${BBS_ROOT_DIR}/config \
&& pm2 start ${BBS_ROOT_DIR}/main.js \
&& rm -rf ${BBS_STAGING_PATH}/config
VOLUME ${BBS_ROOT_DIR}/art \
${BBS_ROOT_DIR}/config \
${BBS_ROOT_DIR}/db \
${BBS_ROOT_DIR}/filebase \
${BBS_ROOT_DIR}/logs \
${BBS_ROOT_DIR}/mods \
/mail
# enigma storage mounts
VOLUME /enigma-bbs/art
VOLUME /enigma-bbs/config
VOLUME /enigma-bbs/db
VOLUME /enigma-bbs/filebase
VOLUME /enigma-bbs/logs
VOLUME /enigma-bbs/mods
VOLUME /mail
# Enigma default port
EXPOSE 8888 44510 44511
WORKDIR ${BBS_ROOT_DIR}
WORKDIR /enigma-bbs
ENTRYPOINT ["/enigma-bbs/docker/bin/docker-entrypoint.sh"]