Skip to content

Commit

Permalink
Add 'BRANCH' argument to Dockerfile for optional branch building
Browse files Browse the repository at this point in the history
  • Loading branch information
Misterblue committed Nov 3, 2020
1 parent 650824f commit 4e81b42
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docker/Dockerfile
@@ -1,9 +1,11 @@
# Dockerfile for building a runable version of the Iamus metaverse-server
FROM node:14 as iamus-build

ARG BRANCH=master

RUN mkdir -p /usr/local/src \
&& cd /usr/local/src \
&& git clone --depth 1 https://github.com/Misterblue/Iamus.git
&& git clone --depth 1 --branch ${BRANCH} https://github.com/Misterblue/Iamus.git

RUN cd /usr/local/src/Iamus \
&& npm install
Expand All @@ -27,10 +29,15 @@ USER ${USER}:${USER}
RUN mkdir -p /home/${USER}/Iamus/dist \
mkdir -p /home/${USER}/config

# Copy over the built files
COPY --from=iamus-build --chown=${USER}:${USER} /usr/local/src/Iamus/package*.json /home/${USER}/Iamus/
COPY --from=iamus-build --chown=${USER}:${USER} /usr/local/src/Iamus/dist /home/${USER}/Iamus/dist
RUN cd /home/${USER}/Iamus && npm install --production

# Install the production NPM packages
RUN cd /home/${USER}/Iamus \
&& npm install --production

# The startup scripts
COPY --chown=${USER}:${USER} ./files/run-iamus.sh /home/${USER}
COPY --chown=${USER}:${USER} ./files/GetVersion.sh /home/${USER}

Expand Down

0 comments on commit 4e81b42

Please sign in to comment.