-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
21 lines (17 loc) · 718 Bytes
/
Dockerfile
File metadata and controls
21 lines (17 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FROM lgatica/node-ssh:10.4.1@sha256:bced64056ceb9a02b8d8b2b0228c899be8f3370fed507034e533ef8b7e2a7ca2
ONBUILD ARG KNOWN_HOST
ONBUILD ARG SSH_PRIVATE_KEY
ONBUILD ARG NODE_ENV
ONBUILD ENV NODE_ENV $NODE_ENV
ONBUILD RUN ssh-keyscan $KNOWN_HOST > /root/.ssh/known_hosts && \
echo "$SSH_PRIVATE_KEY" > /root/.ssh/id_rsa && \
chmod 600 /root/.ssh/id_rsa && \
echo " IdentityFile /root/.ssh/id_rsa" >> /etc/ssh/ssh_config
ONBUILD COPY package.json package-lock.* yarn.* /usr/src/app/
ONBUILD RUN if [ -e yarn.lock ]; \
then yarn && yarn cache clean; \
else npm i && npm cache clean --force; fi && \
apk del .build-deps && \
rm -rf ~/.node-gyp /tmp/*
ONBUILD COPY . /usr/src/app
CMD [ "node", "index.js" ]