forked from pm4ml/connection-manager-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
68 lines (49 loc) · 1.81 KB
/
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
FROM node:14-buster
# Install cfssl
RUN apt-get -y install wget
RUN wget https://dl.google.com/go/go1.12.1.linux-amd64.tar.gz -q -O - | tar -zxf - -C /usr/local
# golang env
ENV GOPATH /go
ENV GOROOT /usr/local/go
ENV PATH $PATH:$GOROOT/bin:$GOPATH/bin/
# Install cfssl with Go and clean up
RUN rm -rf $GOPATH/src/github.com/cloudflare/cfssl
# WARNING: The next layer will be cached, it won't be re-fetched even if the tag changes on the github repo.
RUN git clone https://github.com/modusintegration/cfssl.git --branch=v1.3.4 $GOPATH/src/github.com/cloudflare/cfssl
# If we want to fetch latest from master, we need disable cache from this layer on
# To do this run docker build --no-cache
# Or pass a different value to CACHEBUST like --build-arg CACHEBUST=$(date +%s) and enable the commented out lines below
# as in docker-compose build --build-arg CACHEBUST=$(date +%s)
# ARG CACHEBUST=none
# RUN git clone https://github.com/modusintegration/cfssl.git $GOPATH/src/github.com/cloudflare/cfssl
WORKDIR $GOPATH/src/github.com/cloudflare/cfssl
# home made: build locally
RUN make
RUN ls -l bin
RUN cp bin/* /usr/bin
# clean up
RUN rm -rf ${GOROOT} ${GOPATH}
# There are some other alternatives, check
# https://github.com/modusintegration/cfssl/blob/master/Dockerfile
# For a minimal version see https://github.com/modusintegration/cfssl/blob/master/Dockerfile.minimal
# Check cfssl version
RUN which cfssl
RUN cfssl version
# APP
WORKDIR /usr/src/app
ARG API_BUILD
ENV API_BUILD=$API_BUILD
ARG API_COMMIT
ENV API_COMMIT=$API_COMMIT
ARG API_DESCRIBE
ENV API_DESCRIBE=$API_DESCRIBE
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
RUN npm ci --only=prod
# My app sources
COPY . .
EXPOSE 3001
# run!
CMD ["npm", "start"]