Skip to content

Commit

Permalink
Add dockerfile for easy usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
dakulov committed Aug 14, 2019
1 parent 0ff7c28 commit e14f2a9
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
@@ -0,0 +1,2 @@
**/node_modules
**/dist
9 changes: 9 additions & 0 deletions Dockerfile
@@ -0,0 +1,9 @@
FROM node:10-slim
COPY ./ /app
WORKDIR /app
RUN npm install && npm run build

FROM nginx:alpine
RUN mkdir /app
COPY --from=0 /app/dist /app
COPY nginx.conf /etc/nginx/nginx.conf
17 changes: 17 additions & 0 deletions README.md
Expand Up @@ -55,6 +55,23 @@ and doesn't require a backend.

You can run this simple web app using any web server.

#### Build docker container

- Install [Docker](https://www.docker.com/) if needed.
- Build docker image

```
docker build . -t pev2
```

- Run docker container

```
docker run -d -p 8080:80 pev2
```

After few seconds, open `http://localhost:8080` to enjoy pev2.

## Plan Vue Component

As opposed to [PEV][pev], PEV2 can be used as a component in a third-party
Expand Down
30 changes: 30 additions & 0 deletions nginx.conf
@@ -0,0 +1,30 @@
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
root /app;
index index.html;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}

0 comments on commit e14f2a9

Please sign in to comment.