-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
28 lines (21 loc) · 965 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Create a layer from the Node Alpine Docker image
FROM node:10.15.3-alpine
# Install dockerize
RUN apk add --no-cache openssl
ENV DOCKERIZE_VERSION v0.6.1
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz
# Create the app directory inside the Docker image
RUN mkdir -p /usr/src/group-communication-survey-api
WORKDIR /usr/src/group-communication-survey-api
# Copy package.json & yarn.lock into the root of the directory created above
COPY package.json yarn.lock ./
# Install app dependencies
RUN yarn install --no-cache --frozen-lockfile
# Bundle app source inside Docker image
COPY . .
# Expose port
EXPOSE 4000
# Run app once database is ready
CMD dockerize -wait tcp://mongodb:27017 -timeout 60m yarn start