diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bbf0d17 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +# to build mydraftcc +FROM alpine:latest as builder +RUN apk add --no-cache nodejs npm git bash +RUN git clone https://git.mytinydc.com/Mytinydc/mydraftcc-nodejs-server.git \ + && cd mydraftcc-nodejs-server \ + && git submodule update --init +WORKDIR /mydraftcc-nodejs-server +# If you want to patch with "optional" +ARG PATCHOPTIONS +RUN ./patch.sh "${PATCHOPTIONS}" +RUN cd ui && npm install && npm run build + +# Final image server and built ui from previous step +FROM alpine:latest as main +RUN apk add --no-cache nodejs npm +COPY --from=builder /mydraftcc-nodejs-server/server / +COPY --from=builder /mydraftcc-nodejs-server/ui/build /public +RUN npm install + +# Volumes mounpoint +RUN mkdir /data /logs +##VOLUME logs data +# run with user/group 1000 +USER 1000:1000 +# exposed port +EXPOSE 4000 +# Env Vars +ENV IPADDRESS=0.0.0.0 +ENV PORT=4000 +# Storage: maximum size of the drawing file +# (2Mo : 2 * 1024 * 1024) = 2097152 +ENV JSONMAXSIZE=2097152 + + +CMD ["/usr/bin/node","/app.js"] diff --git a/patch.sh b/patch.sh index df06463..5e2de33 100755 --- a/patch.sh +++ b/patch.sh @@ -6,7 +6,7 @@ # So default is keeping, to remove from source, execute : # ./patch.sh "optional" ############################################################## - +echo "Option $1" echo "[INFO]Starting applying patches..." ## required for nodejs-server diff --git a/start.sh b/start.sh deleted file mode 100755 index 49fd46e..0000000 --- a/start.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -cd server && npm install && ./start.sh \ No newline at end of file