Skip to content

Commit b79b461

Browse files
Added instructions
1 parent 662caad commit b79b461

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,17 @@ A simple nginx container that serves Single Page Applications:
44
- Redirects all requests to the `index.html` file
55
- Assets compression using `gzip` in stylesheets and javascript files.
66

7+
[Docker Hub](https://hub.docker.com/r/iamfreee/docker-nginx-static-spa/)
8+
9+
## Instructions
10+
11+
**Dockerfile:**
12+
```
13+
FROM iamfreee/docker-nginx-static-spa:latest
14+
COPY /dist /usr/share/nginx/html
15+
```
16+
17+
In the example above, the production build of the app is in the local `dist` folder and is moved to the default nginx serve path to be served.
18+
719
## License
820
MIT

default.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
server {
22
listen 80; ## listen for ipv4; this line is default and implied
3-
listen [::]:80 default ipv6only=on; ## listen for ipv6
3+
listen [::]:80 default ipv6only=on; ## listen for ipv6
44

5-
root /var/www/html;
6-
index index.html;
5+
root /var/www/html;
6+
index index.html;
77

88
server_tokens off; # disable the Server nginx header
99

10-
server_name _; # all hostnames
10+
server_name _; # all hostnames
1111

1212
# enable gzip
1313
gzip on;

0 commit comments

Comments
 (0)