forked from razee-io/Razeedash-api
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba1badd
commit c1c5030
Showing
2 changed files
with
35 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,8 @@ build-tools/ | |
.nyc_output/ | ||
coverage/ | ||
test/ | ||
compose/ | ||
compose/ | ||
.* | ||
build/ | ||
kubernetes/ | ||
samples/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,48 @@ | ||
#Build an intermediate image, have to use 12.x.x node since 13.x is not working for bcrypt yet | ||
################################################################################ | ||
# Copyright 2019 IBM Corp. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
################################################################################ | ||
####################################### | ||
# Build the preliminary image | ||
####################################### | ||
FROM node:lts-alpine as buildImg | ||
|
||
RUN apk update | ||
RUN apk --no-cache add gnupg python make | ||
RUN apk add --upgrade --no-cache libssl1.1 | ||
RUN apk add --no-cache g++ | ||
RUN apk --no-cache add python make g++ | ||
|
||
RUN mkdir -p /usr/src/ | ||
ENV PATH="$PATH:/usr/src/" | ||
|
||
WORKDIR /usr/src/ | ||
COPY package.json /usr/src/ | ||
COPY package-lock.json /usr/src/ | ||
USER node | ||
WORKDIR /home/node | ||
|
||
COPY --chown=node . /home/node | ||
RUN npm install --production --loglevel=warn | ||
COPY . /usr/src/ | ||
|
||
|
||
####################################### | ||
# Build the production image | ||
####################################### | ||
FROM node:lts-alpine | ||
RUN apk add --upgrade --no-cache libssl1.1 | ||
|
||
RUN mkdir -p /usr/src/ | ||
ENV PATH="$PATH:/usr/src/" | ||
USER node | ||
WORKDIR /home/node | ||
|
||
RUN export BUILD_TIME=`date '+%Y-%m-%d %H:%M:%S'` | ||
|
||
WORKDIR /usr/src/ | ||
COPY --from=buildImg /usr/src /usr/src | ||
|
||
ARG BUILD_TIME | ||
ENV BUILD_TIME=${BUILD_TIME} | ||
ARG BUILD_ID | ||
ENV BUILD_ID=${BUILD_ID} | ||
|
||
ARG BUILD_TIME | ||
ENV BUILD_TIME=${BUILD_TIME} | ||
COPY --chown=node --from=buildImg /home/node /home/node | ||
|
||
EXPOSE 3333 | ||
CMD ["npm", "start"] |