-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
94 lines (69 loc) · 2.62 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
FROM node:slim AS builder
LABEL stage=builder
USER root
RUN apt-get update
RUN apt-get install -y build-essential git libfst-dev python
RUN mkdir -p /opt/nutrimatic
WORKDIR /opt/nutrimatic
RUN wget https://github.com/egnor/nutrimatic/tarball/master
RUN tar xzf master --strip 1
RUN rm master
RUN mkdir -p /opt/julia
WORKDIR /opt/julia
RUN wget https://julialang-s3.julialang.org/bin/linux/x64/0.5/julia-0.5.2-linux-x86_64.tar.gz
RUN tar xzf julia-0.5.2-linux-x86_64.tar.gz --strip 1
RUN rm julia-0.5.2-linux-x86_64.tar.gz
RUN ln -s /opt/julia/lib/julia /usr/local/lib/julia
RUN mkdir -p /root/.julia/v0.5/Collective
WORKDIR /root/.julia/v0.5/Collective
RUN git clone https://github.com/obijywk/Collective.jl.git .
RUN mkdir -p /root/.julia/v0.5/Compat
WORKDIR /root/.julia/v0.5/Compat
RUN git clone --branch v0.9.0 https://github.com/JuliaLang/Compat.jl.git .
RUN mkdir -p /root/.julia/v0.5/DataStructures
WORKDIR /root/.julia/v0.5/DataStructures
RUN git clone --branch v0.4.6 https://github.com/JuliaCollections/DataStructures.jl.git .
RUN mkdir -p /root/.julia/v0.5/Iterators
WORKDIR /root/.julia/v0.5/Iterators
RUN git clone --branch v0.2.0 https://github.com/JuliaCollections/Iterators.jl.git .
RUN /opt/julia/bin/julia -e 'using Collective'
RUN mkdir -p /opt/solvent
COPY data /opt/solvent/data
COPY public /opt/solvent/public
COPY binding.gyp /opt/solvent/
COPY credentials.json /opt/solvent/
COPY package.json /opt/solvent/
COPY tsconfig.json /opt/solvent/
COPY tslint.json /opt/solvent/
COPY webpack.config.js /opt/solvent/
COPY src /opt/solvent/src
WORKDIR /opt/solvent
RUN npm install
RUN npm run build-native
RUN npm run build-server
RUN npm run build-client
ENV HOME /root
EXPOSE 8080
CMD ["npm", "run", "run-server"]
FROM node:slim
USER root
RUN apt-get update
RUN apt-get install -y libfst4
COPY --from=builder /usr/local/lib/julia/ /usr/local/lib/julia/
RUN mkdir -p /opt/julia/lib
COPY --from=builder /opt/julia/lib/ /opt/julia/lib/
RUN mkdir -p /root/.julia
COPY --from=builder /root/.julia/ /root/.julia/
RUN mkdir -p /opt/solvent /opt/solvent/build/Release
COPY --from=builder /opt/solvent/credentials.json /opt/solvent/credentials.json
COPY --from=builder /opt/solvent/package.json /opt/solvent/package.json
COPY --from=builder /opt/solvent/build/Release/*.node /opt/solvent/build/Release/
COPY --from=builder /opt/solvent/built/ /opt/solvent/built/
COPY --from=builder /opt/solvent/data/ /opt/solvent/data/
COPY --from=builder /opt/solvent/dist/ /opt/solvent/dist/
COPY --from=builder /opt/solvent/public/ /opt/solvent/public/
WORKDIR /opt/solvent
RUN npm install --only=prod
ENV HOME /root
EXPOSE 8080
CMD ["npm", "run", "run-server"]