-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile.r2g
57 lines (41 loc) · 1.55 KB
/
Dockerfile.r2g
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
FROM node:9
RUN apt-get -y update
RUN apt-get -y install sudo
RUN sudo apt-get -y update
RUN apt-get install -y netcat
RUN apt-get install -y rsync
ENV FORCE_COLOR=1
ENV docker_r2g_in_container=yes
ENV MY_DOCKER_R2G_SEARCH_ROOT="/home/node"
RUN sudo echo "node ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
USER node
RUN mkdir -p /home/node/app/node_modules
RUN mkdir -p /home/node/.docker_r2g_cache
ENV USER="node"
ENV HOME="/home/node"
RUN mkdir -p "/home/node/.npm"
RUN mkdir -p "/home/node/app/node_modules"
WORKDIR "/home/node/app"
RUN sudo chmod -R 777 /home/node
RUN sudo chown -R $(whoami) $(npm config get prefix)/lib
RUN sudo chown -R $(whoami) $(npm config get prefix)/lib/node_modules
RUN sudo chown -R $(whoami) $(npm config get prefix)/bin
RUN sudo chown -R $(whoami) $(npm config get prefix)/share
RUN sudo chown -R $(whoami) /usr/local/lib
RUN sudo chown -R $(whoami) /usr/local/etc
RUN npm set unsafe-perm true
RUN npm set cache-min 9999999
RUN npm set progress=false
ARG CACHEBUST=1
RUN npm install --loglevel=warn -g \
"https://raw.githubusercontent.com/oresoftware/tarballs/master/tgz/oresoftware/npm.cache.tgz?$(date +%s)"
COPY package.json .
COPY .docker.r2g .docker.r2g
RUN update_npm_cache
RUN npm install --loglevel=warn -g \
"https://raw.githubusercontent.com/oresoftware/tarballs/master/tgz/oresoftware/docker.r2g.tgz?$(date +%s)"
RUN npm install --loglevel=warn -g \
"https://raw.githubusercontent.com/oresoftware/tarballs/master/tgz/oresoftware/r2g.tgz?$(date +%s)"
COPY . .
RUN sudo chmod -R 777 /home/node
ENTRYPOINT ["docker.r2g", "run"]