diff options
-rw-r--r-- | .dockerignore | 18 | ||||
-rw-r--r-- | Dockerfile | 27 | ||||
-rw-r--r-- | README.md | 9 |
3 files changed, 54 insertions, 0 deletions
diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..78b3e36d8 --- /dev/null +++ b/.dockerignore | |||
@@ -0,0 +1,18 @@ | |||
1 | node_modules | ||
2 | flow-typed | ||
3 | out | ||
4 | .DS_Store | ||
5 | .idea | ||
6 | build | ||
7 | .tmp | ||
8 | .stage | ||
9 | .env | ||
10 | yarn-error.log | ||
11 | npm-debug.log* | ||
12 | lerna-debug.log | ||
13 | uidev/lib | ||
14 | *.tsbuildinfo | ||
15 | .dockerignore | ||
16 | Dockerfile | ||
17 | .git* | ||
18 | *.md | ||
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..c30270660 --- /dev/null +++ b/Dockerfile | |||
@@ -0,0 +1,27 @@ | |||
1 | FROM node:14 as builder | ||
2 | |||
3 | RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
4 | && apt-get -y install --no-install-recommends libx11-dev libxext-dev libxss-dev libxkbfile-dev rpm \ | ||
5 | && apt-get autoremove -y \ | ||
6 | && apt-get clean -y \ | ||
7 | && rm -rf /var/lib/apt/lists/* | ||
8 | |||
9 | WORKDIR /usr/src/ferdi | ||
10 | |||
11 | COPY package*.json ./ | ||
12 | COPY lerna.json ./ | ||
13 | |||
14 | RUN npm i gulp@^4.0.0 | ||
15 | RUN npx lerna bootstrap | ||
16 | |||
17 | COPY . . | ||
18 | |||
19 | RUN npm run build | ||
20 | |||
21 | FROM busybox | ||
22 | |||
23 | WORKDIR /ferdi | ||
24 | |||
25 | COPY --from=builder /usr/src/ferdi/out/* /ferdi/ | ||
26 | |||
27 | VOLUME [ "/ferdi-out" ] | ||
@@ -299,6 +299,15 @@ $ cd recipes | |||
299 | $ npm install && npm run package | 299 | $ npm install && npm run package |
300 | ``` | 300 | ``` |
301 | 301 | ||
302 | ### Using Docker to build a package | ||
303 | |||
304 | ```bash | ||
305 | $ docker build -t ferdi-package . | ||
306 | $ docker run -v tmp-out:/ferdi-out -it ferdi-package sh | ||
307 | ``` | ||
308 | |||
309 | The above will place all the built artifacts into the `/ferdi` folder within the image. If you want to copy them outside of the image, simply mount a volume into a different location, and copy all files from `/ferdi` into the mounted folder (`/ferdi-out` in the 2nd example command above). | ||
310 | |||
302 | ### Start development app | 311 | ### Start development app |
303 | 312 | ||
304 | Run these two commands **simultaneously** in different terminals: | 313 | Run these two commands **simultaneously** in different terminals: |