Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider 77f61020 rédigé par Will Hunt's avatar Will Hunt Validation de GitHub
Parcourir les fichiers

Merge pull request #255 from oleg-fiksel/develop

Use multistaged Docker build.
parents 54540dd2 66b5d0dd
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
FROM node:alpine FROM node:alpine AS BUILD
COPY . /tmp/src COPY . /tmp/src
# install some dependencies needed for the build process
RUN apk add --no-cache -t build-deps make gcc g++ python ca-certificates libc-dev wget \ RUN apk add --no-cache -t build-deps make gcc g++ python ca-certificates libc-dev wget
&& cd /tmp/src \ RUN cd /tmp/src \
&& npm install \ && npm install \
&& npm run build \ && npm run build
&& mv build / \
&& mv config / \
&& mv node_modules / \
&& cd / \
&& rm -rf /tmp/* \
&& apk del build-deps \
&& sh -c 'cd /build/tools; for TOOL in *.js; do LINK="/usr/bin/$(basename $TOOL .js)"; echo -e "#!/bin/sh\ncd /data;\nnode /build/tools/$TOOL \$@" > $LINK; chmod +x $LINK; done'
FROM node:alpine
ENV NODE_ENV=production ENV NODE_ENV=production
COPY --from=BUILD /tmp/src/build /build
COPY --from=BUILD /tmp/src/config /config
COPY --from=BUILD /tmp/src/node_modules /node_modules
RUN sh -c 'cd /build/tools; for TOOL in *.js; do LINK="/usr/bin/$(basename $TOOL .js)"; echo -e "#!/bin/sh\ncd /data;\nnode /build/tools/$TOOL \$@" > $LINK; chmod +x $LINK; done'
CMD node /build/src/discordas.js -p 9005 -c /data/config.yaml -f /data/discord-registration.yaml CMD node /build/src/discordas.js -p 9005 -c /data/config.yaml -f /data/discord-registration.yaml
EXPOSE 9005 EXPOSE 9005
VOLUME ["/data"] VOLUME ["/data"]
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter