-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
49 lines (43 loc) · 1.39 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
# syntax=docker/dockerfile:1.4
########## Node image ##################
FROM 127178877223.dkr.ecr.us-east-2.amazonaws.com/get-bridge/core:bionic
LABEL com.get-bridge.image.authors="get-brige"
USER root
WORKDIR /usr/src/app
ENV NODE_MAJOR 10
ENV NODE_VERSION 10.24.1
ENV NPM_VERSION 6.14.12
ENV YARN_VERSION 1.22.19
RUN <<EOT
#/usr/bin/env bash
set -exu
mkdir -p /usr/src/app
chown docker:docker /usr/src/app
apt-get update
apt-get install --yes --no-install-recommends \
gnupg
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | apt-key add -
echo "deb https://deb.nodesource.com/node_10.x bionic main" \
> /etc/apt/sources.list.d/nodesource.list
apt-get update
apt-get install --yes --no-install-recommends \
nodejs
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
npm install --global "npm@${NPM_VERSION}"
npm install --global "yarn@${YARN_VERSION}"
rm -rf /root/.npm/_cacache
npm cache clean --force
# Install build dependencies for fat image, NOTE: fat image is NOT meant to be deployed to production
apt-get update
apt-get install --yes --no-install-recommends \
build-essential
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Check that node commands work
[ "$(command -v node)" = '/usr/bin/node' ]
[ "$(command -v npm)" = '/usr/bin/npm' ]
[ "$(command -v yarn)" = '/usr/bin/yarn' ]
node -v
npm -v
yarn -v
EOT
USER docker