-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support running malibu in docker (#61)
- Loading branch information
Showing
8 changed files
with
8,421 additions
and
11,823 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,12 @@ $ git pull [email protected]:quintype/malibu.git master | |
$ git checkout --ours app/isomorphic/components | ||
$ git add app/isomorphic/components | ||
``` | ||
|
||
## Running on Windows | ||
|
||
Here are some considerations while running on windows | ||
* Please install docker (Docker for Desktop on Windows Enterprise / Professional, and Docker Toolbox on Windows Home) | ||
* The app is to be run as follows: `./dev-docker/start` | ||
* In case localhost:3000 shows a connection refused, you can forward ports to the `docker-machine` as follows `./dev-docker/port-forward`. This should only be needed on Windows home | ||
* Windows uses nodemon and webpack polling to detect updates. This eats CPU | ||
* You can use `./dev-docker/force-reload` to force the web server and webpack to reload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM node:10.15-alpine | ||
|
||
RUN apk update && \ | ||
apk add bash tini && \ | ||
addgroup -S app && \ | ||
adduser -S -g app app | ||
|
||
RUN mkdir -p /app/node_modules && chown app:app -R /app | ||
VOLUME ["/app", "/app/node_modules"] | ||
|
||
WORKDIR /app | ||
USER app | ||
|
||
ENTRYPOINT ["/sbin/tini", "--"] | ||
CMD ["bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
docker-compose exec web touch app/isomorphic/app-version.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
docker-machine ssh default -fN -L 3000:localhost:3000 -L 8080:localhost:8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
|
||
export NODEMON_OPTS="" | ||
export WEBPACK_DEV_OPTS="" | ||
|
||
if [[ "$(pwd)" != "$HOME"* ]]; then | ||
echo This script must be run in a codebase located within the $HOME folder. Please re-clone this repository and try again | ||
exit 1 | ||
fi | ||
|
||
if [ "$MSYSTEM" == "MINGW64" ]; then | ||
export NODEMON_OPTS="$NODEMON_OPTS --polling-interval 200" | ||
export WEBPACK_DEV_OPTS="$WEBPACK_DEV_OPTS --watch-poll" | ||
fi | ||
|
||
docker-compose build &&\ | ||
docker-compose run web npm install &&\ | ||
docker-compose up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: '3' | ||
services: | ||
web: &common | ||
build: ./dev-docker | ||
volumes: | ||
- .:/app | ||
- node_modules:/app/node_modules | ||
dns: | ||
- 8.8.8.8 | ||
- 1.1.1.1 | ||
ports: ["3000:3000"] | ||
command: sh -c 'npm run compile && npm run dev-server -- ${NODEMON_OPTS}' | ||
assets: | ||
<<: *common | ||
ports: ["8080:8080"] | ||
command: npm run asset-server -- --host 0.0.0.0 ${WEBPACK_DEV_OPTS} | ||
volumes: | ||
node_modules: |
Oops, something went wrong.