forked from chili-epfl/FROG
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate-Dockerfile.js
52 lines (45 loc) · 1.67 KB
/
create-Dockerfile.js
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
const fs = require('fs');
fs.readdir('./ac', (_, ac) => {
fs.readdir('./op', (__, op) => {
const acop = [...ac.map(x => 'ac/' + x), ...op.map(x => 'op/' + x)];
const acopSrc = acop.map(dir => dir + '/src').join(' \\\n');
const acopCP = acop
.map(dir => `COPY ${dir}/package.json ${dir}/`)
.join('\n');
const template = `FROM node:10-jessie
RUN apt-get update && apt-get install -y ocaml libelf-dev
RUN curl -sL https://install.meteor.com | sed s/--progress-bar/-sL/g | /bin/sh
RUN mkdir -p /usr/src/frog/frog && chmod a+rwx -R /usr/src/frog
WORKDIR /usr/src/frog
RUN mkdir -p ./flow-typed
COPY flow-typed flow-typed/
RUN mkdir -p frog/.meteor frog/server && \\
echo "import './shutdown-if-env.js';" > frog/server/main.js
COPY frog/imports/startup/shutdown-if-env.js frog/server
COPY frog/.meteor/packages frog/.meteor/versions frog/.meteor/release frog/.meteor/
ENV LANG='C.UTF-8' LC_ALL='C.UTF-8'
RUN cd /usr/src/frog/frog && METEOR_SHUTDOWN=true /usr/local/bin/meteor --once --allow-superuser; exit 0
RUN mkdir -p __mocks__ frog-utils/src \\
${acopSrc}
COPY package.json yarn.lock .yarnrc ./
COPY yarn.lock yarn.lock.orig
COPY __mocks__ ./__mocks__
COPY *.sh linkFiles.js package-scripts.js ./
COPY frog-utils/package.json frog-utils/
${acopCP}
COPY frog/package.json frog/babel.config.js frog/
WORKDIR /usr/src/frog
RUN /usr/src/frog/initial_setup.sh
COPY ac /usr/src/frog/ac/
COPY op /usr/src/frog/op/
COPY frog-utils /usr/src/frog/frog-utils/
COPY frog /usr/src/frog/frog/
COPY *.js .*ignore *config ./
RUN /usr/src/frog/initial_setup.sh --single
EXPOSE 3000
CMD [ "npm", "start", "test.ci" ]
`;
// eslint-disable-next-line
console.log(template);
});
});