-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
61 lines (47 loc) · 1.42 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
50
51
52
53
54
55
56
57
58
59
60
61
FROM node:latest
# ARGS
ARG PROJECT_NAME=developer7/wfp-alexa-backend
# get default node user : 'node'
ARG USER=node
ARG WORKSPACE=/usr/dockers/devapp
# update system
RUN apt-get update
# allow npm to install as root user
#other solution : RUN npm -g install nodegit --unsafe-perm
RUN npm -g config set user root
# Create app directory
WORKDIR $WORKSPACE
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
#install project dependencies
RUN npm install --silent
RUN npm -v
# Bundle app source
COPY . .
# copy the check script : do what you want. see below for the call
COPY ./Docker/check-project.sh ./Docker/check-project.sh
##
# Since we are not creating any user here, you need to add the default docker's user
# to your computer by updatinf both following files:
# nano /etc/subuid
# nano /etc/subgid
# https://blog.ippon.tech/docker-and-permission-management/
#
# Exemple of content :
# currentUser:1000:65536
#
# add node user
# node:1000:65536
##
RUN chown -R $USER:$USER $WORKSPACE
RUN echo fs.inotify.max_user_watches=524288 >> /etc/sysctl.conf
RUN cat /proc/sys/fs/inotify/max_user_watches
USER $USER
RUN git config --global user.email "[email protected]"
RUN git config --global user.name "axel.reliefapps"
RUN npm -g config set user $USER
RUN ls -la
RUN bash Docker/check-project.sh $PROJECT_NAME
EXPOSE 12113