forked from hirako2000/riju
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.prod
71 lines (53 loc) · 2.43 KB
/
Dockerfile.prod
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
62
63
64
65
66
67
68
69
70
71
FROM ubuntu:rolling
# This is just here so we can reuse the Docker cache between dev and
# prod, it's not actually read by anything.
ARG UID
COPY scripts/my_init /usr/bin/my_init
COPY scripts/docker-install-phase0.bash /tmp/
RUN bash -c "time /tmp/docker-install-phase0.bash"
COPY scripts/docker-install-phase1.bash /tmp/
RUN bash -c "time /tmp/docker-install-phase1.bash"
COPY scripts/docker-install-phase2.bash /tmp/
RUN bash -c "time /tmp/docker-install-phase2.bash"
COPY scripts/docker-install-phase3a.bash /tmp/
RUN bash -c "time /tmp/docker-install-phase3a.bash"
COPY scripts/docker-install-phase3b.bash /tmp/
RUN bash -c "time /tmp/docker-install-phase3b.bash"
COPY scripts/docker-install-phase3c.bash /tmp/
RUN bash -c "time /tmp/docker-install-phase3c.bash"
COPY scripts/docker-install-phase3d.bash /tmp/
RUN bash -c "time /tmp/docker-install-phase3d.bash"
COPY scripts/docker-install-phase4.bash /tmp/
RUN bash -c "time /tmp/docker-install-phase4.bash"
COPY scripts/docker-install-phase5.bash /tmp/
RUN bash -c "time /tmp/docker-install-phase5.bash"
COPY scripts/docker-install-phase6.bash /tmp/
RUN bash -c "time /tmp/docker-install-phase6.bash"
COPY scripts/docker-install-phase7.bash /tmp/
RUN bash -c "time /tmp/docker-install-phase7.bash"
COPY scripts/docker-install-phase8.bash /tmp/
RUN bash -c "time /tmp/docker-install-phase8.bash '$UID'"
USER docker
WORKDIR /home/docker
RUN chmod go-rwx /home/docker
EXPOSE 6119
EXPOSE 6120
ENTRYPOINT ["/usr/bin/my_init", "/usr/local/bin/pid1.bash"]
COPY scripts/pid1.bash /usr/local/bin/
CMD ["yarn", "run", "server"]
RUN mkdir /tmp/riju /tmp/riju/scripts
COPY --chown=docker:docker package.json yarn.lock /tmp/riju/
RUN bash -c "cd /tmp/riju && time yarn install"
COPY --chown=docker:docker webpack.config.js tsconfig.json tsconfig-webpack.json /tmp/riju/
COPY --chown=docker:docker frontend /tmp/riju/frontend
RUN bash -c "cd /tmp/riju && time yarn run frontend"
COPY --chown=docker:docker backend /tmp/riju/backend
RUN bash -c "cd /tmp/riju && time yarn run backend"
COPY --chown=docker:docker scripts/compile-system.bash /tmp/riju/scripts
COPY --chown=docker:docker system /tmp/riju/system
RUN bash -c "cd /tmp/riju && time RIJU_PRIVILEGED=1 yarn run system"
COPY --chown=docker:docker . /home/docker/src
RUN sudo cp -a /tmp/riju/* /home/docker/src/ && rm -rf /tmp/riju
WORKDIR /home/docker/src
RUN sudo deluser docker sudo
RUN RIJU_PRIVILEGED=1 CONCURRENCY=1 TIMEOUT_FACTOR=5 LANG=C.UTF-8 LC_ALL=C.UTF-8 yarn test