-
Notifications
You must be signed in to change notification settings - Fork 110
/
Dockerfile
41 lines (33 loc) · 799 Bytes
/
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
FROM mhart/alpine-node:6
# Install required dependencies (Alpine Linux packages)
RUN apk update && \
apk add --no-cache \
sudo \
g++ \
gcc \
git \
libev-dev \
libevent-dev \
libuv-dev \
make \
openssl-dev \
perl \
python
# Add user and make it sudoer
ARG uid=1000
ARG user
RUN adduser -DS -u $uid $user
RUN echo $user' ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# Switch to directory for external dependencies (installed from source)
WORKDIR /external
# Install (global) NPM packages/dependencies
RUN npm install -g \
node-gyp
# Make project directory with permissions
RUN mkdir /project
# Switch to project directory
WORKDIR /project
# Copy required stuff
COPY . .
# Install (local) NPM packages and build
RUN npm install && npm run postinstall