Skip to content

Commit

Permalink
Add docker-compose for nginx as dev http-server. Update README.md wit…
Browse files Browse the repository at this point in the history
…h usage instructions.
  • Loading branch information
kaisalmen committed Oct 6, 2017
1 parent 6a6a2e8 commit 7c3d3d3
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 5 deletions.
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
/node
/node_modules

/resource/obj/14
/resource/obj/1701
/resource/obj/11707
/resource/obj/11811
/resource/obj/12120
/resource/obj/1*
/resource/obj/capsule
/resource/obj/Cerberus
/resource/obj/datamogensen
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,20 @@ Version 2.0.0 introduced substantial enhancements and chances especially but not
[LoaderDirector - Mesh Spray](https://kaisalmen.de/proto/test/meshspray/main.src.html)<br>
[LoaderDirector Parallels Demo](https://kaisalmen.de/proto/test/wwparallels/main.src.html)<br>

## Http server for development
If you have `docker` and `docker-compose` installed on your development platform, you are now able to launch `nginx` which is serving the complete content of this repository. Any changes to files are directly available in the HTTP server. This is solely meant for development.

From the command-line, use the following command to launch the HTTP server:
```bash
docker-compose up -d
```
Content is available here: [http://localhost:8085](http://localhost:8085)<br>
Nginx configuration is stored here: `resource/nginx/nginx.conf`. Adjust according your needs.

From the command-line, use the following to stop the HTTP server:
```bash
docker-compose down
```

Have fun!

Expand Down
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3.3'

services:
obj2nginx:
image: nginx
ports:
- 8085:80
volumes:
- .:/usr/share/nginx/html:ro
- ./resource/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
container_name: obj2nginx
34 changes: 34 additions & 0 deletions resource/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

worker_processes 1;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

sendfile on;
keepalive_timeout 65;

server {
listen 80;
server_name localhost;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
autoindex on;
}

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

}

}

0 comments on commit 7c3d3d3

Please sign in to comment.