Compare commits
4 Commits
0343b43b50
...
772506e06d
| Author | SHA1 | Date | |
|---|---|---|---|
| 772506e06d | |||
| a39d3b682a | |||
| 0b10386ec0 | |||
| d2cecc1523 |
14
Dockerfile
14
Dockerfile
@@ -1,3 +1,11 @@
|
|||||||
|
FROM node:latest
|
||||||
|
|
||||||
|
WORKDIR /usr/src/
|
||||||
|
|
||||||
|
COPY mojo_app/package.json .
|
||||||
|
COPY mojo_app/package-lock.json .
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
FROM perl:latest
|
FROM perl:latest
|
||||||
|
|
||||||
WORKDIR /opt/app/
|
WORKDIR /opt/app/
|
||||||
@@ -8,9 +16,9 @@ COPY mojo_app ./mojo_app/
|
|||||||
|
|
||||||
RUN cpanm Carton && carton install
|
RUN cpanm Carton && carton install
|
||||||
|
|
||||||
|
WORKDIR /opt/app/mojo_app/
|
||||||
|
COPY --from=0 /usr/src/ .
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
WORKDIR /opt/app/mojo_app/
|
|
||||||
|
|
||||||
ENTRYPOINT ["carton", "exec", "--", "morbo", "script/mojo_app"]
|
ENTRYPOINT ["carton", "exec", "--", "morbo", "script/mojo_app"]
|
||||||
|
|
||||||
|
|||||||
12
README.md
12
README.md
@@ -16,7 +16,17 @@ Visit `localhost:3000` with web browser.
|
|||||||
|
|
||||||
## serve app with local changes
|
## serve app with local changes
|
||||||
|
|
||||||
$ docker run --rm -it -p 3000:3000 -v $PWD:/opt/app mojo_app
|
### install Mojolicious dependencies
|
||||||
|
|
||||||
|
$ docker run --rm -v $PWD:/opt/app --entrypoint carton mojo_app install
|
||||||
|
|
||||||
|
### install Node packages
|
||||||
|
|
||||||
|
$ docker run --rm --init -w /opt/mojo_app -v $PWD/mojo_app:/opt/mojo_app node npm install
|
||||||
|
|
||||||
|
### start the server
|
||||||
|
|
||||||
|
$ docker run --rm -v $PWD:/opt/app -p 3000:3000 mojo_app
|
||||||
|
|
||||||
Visit `localhost:3000` with web browser. Changes should load when you reload
|
Visit `localhost:3000` with web browser. Changes should load when you reload
|
||||||
the page, without having to restart the server.
|
the page, without having to restart the server.
|
||||||
|
|||||||
Reference in New Issue
Block a user