Created
October 22, 2017 11:26
-
-
Save mlabouardy/60509bf9902e4105f9a9488c4bc436cb to your computer and use it in GitHub Desktop.
Prevent race conditions with Dockernize
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:8.7.0 | |
MAINTAINER mlabouardy <[email protected]> | |
RUN apt-get update && apt-get install -y wget | |
ENV DOCKERIZE_VERSION v0.5.0 | |
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ | |
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ | |
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | |
WORKDIR /app | |
RUN npm install mysql express | |
COPY server.js . | |
EXPOSE 3000 | |
CMD dockerize -wait tcp://mysql:3306 -timeout 1m && node server.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment