-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDefault-dockerfile
52 lines (40 loc) · 1.07 KB
/
Default-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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM node:18.13.0
MAINTAINER wiley@nurigo.net
# arguments
ARG SERVICE_NAME
ARG STAGE
ARG NODE_ENV
ENV HOME_DIR /opt/${SERVICE_NAME}
# install middlewares
RUN wget https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64.deb
RUN dpkg -i dumb-init_*.deb
# mkdir app folder
RUN mkdir -p ${HOME_DIR}
WORKDIR ${HOME_DIR}
# set environment variables
ENV NODE_ENV ${NODE_ENV}
ENV PLATFORM_NAME ${STAGE}
# install modules
RUN npm install -g --force yarn
# Install app dependencies
COPY package.json yarn.lock .npmrc ./
RUN yarn install --frozen-lockfile
# copy source files
COPY . ${HOME_DIR}
#{EXTRA_CMD1}
#{EXTRA_CMD2}
#{EXTRA_CMD3}
#{DOCKER_EXTRA_CMD1}
#{DOCKER_EXTRA_CMD2}
#{DOCKER_EXTRA_CMD3}
#{DOCKER_EXTRA_CMD4}
#{DOCKER_EXTRA_CMD5}
# for health check
COPY probe.sh /probe.sh
RUN chmod 0755 /probe.sh
RUN wget https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.4.8/grpc_health_probe-linux-amd64 -O /grpc_health_probe
RUN chmod 0755 /grpc_health_probe
# execution
EXPOSE 7001
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["yarn", "#{START}" ]