Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker image with pm2 balancer #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.git/
node_modules/
dist/
*.log
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:8.5.0
WORKDIR /app
COPY . /app

RUN yarn global add pm2
RUN yarn install && yarn run build

HEALTHCHECK --interval=20s --timeout=3s --retries=3 \
CMD curl -f http://localhost:8080 || exit 1

EXPOSE 8080
CMD ["pm2-docker", "process.yml", "--web", "--json"]
5 changes: 5 additions & 0 deletions docs/Build-Process.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ There are two build process, one for the client and one for the server.

You can start the build process with `npm/yarn run build`. You can also run only the client or the server build process with `yarn run build:client`, `yarn run build:server`.

## Building with Docker

You can run this projct as a docker image with a pm2 load balancer inside. First run `docker build -t projectname ` and then `docker run -p 8080:8080 projectname:latest`.


## Build Variables

Specify the `BUILD_LANGUAGE` environment variable (two letter language code defined in `config.js`) to build the project for a different language, by default `BUILD_LANGUAGE` is `en`.
Expand Down
5 changes: 5 additions & 0 deletions process.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apps:
- script : 'server.js'
name : 'vue-webpack-ssr-fully-featured'
exec_mode: 'cluster'
instances: 4