-
Notifications
You must be signed in to change notification settings - Fork 68
/
Dockerfile
42 lines (36 loc) · 907 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 alpine:3.7
MAINTAINER Jeff Dickey
# Install NodeJS and node-gyp deps
RUN apk --no-cache add \
g++ \
gcc \
make \
bash \
gnupg \
paxctl \
python \
nodejs \
linux-headers
# Create user and group
RUN addgroup -S register \
&& adduser -D -S \
-s /bin/bash \
-h /srv/npm-register \
-G register \
register \
&& mkdir -p /srv/npm-register/src /srv/npm-register/data \
&& chown -R register:register /srv/npm-register \
&& chmod -R g+w /srv/npm-register
# Deploy application
COPY . /srv/npm-register/src
WORKDIR /srv/npm-register/src
RUN npm install \
&& chown -R register:register .
# Share storage volume
ENV NPM_REGISTER_FS_DIRECTORY /srv/npm-register/data
VOLUME /srv/npm-register/data
# Start application
EXPOSE 3000
USER register
ENV NODE_ENV production
CMD ["npm", "start"]