https://github.com/andy9775/docker-nginx-node
https://github.com/andy9775/docker-nginx-node
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/andy9775/docker-nginx-node
- Owner: andy9775
- Created: 2017-03-22T23:18:36.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-22T23:45:25.000Z (about 8 years ago)
- Last Synced: 2025-04-24T00:11:29.294Z (about 2 months ago)
- Language: Nginx
- Size: 33.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
docker-nginx
============A high-performance Nginx base image for Docker to serve static websites. It will serve anything in the `/var/www` directory which includes npm and node to build project files.
To build a Docker image for your site, you'll need to create a `Dockerfile`. For example, if your site is in a directory called `src/`, you could create this `Dockerfile`:
FROM kyma/docker-nginx
COPY src/ /var/www
CMD 'nginx'Then build and run it:
$ docker build -t mysite .
...
Successfully built 5ae2fb5cf4f8
$ docker run -p 80:80 -d mysite
da809981545f
$ curl localhost
...Docker Hub
----------
The trusted build information can be found on the Docker Hub at https://registry.hub.docker.com/u/kyma/docker-nginx/.SSL
---To use SSL, put your certs in `/etc/nginx/ssl` and enable the `default-ssl` site:
ADD server.crt /etc/nginx/ssl/
ADD server.key /etc/nginx/ssl/
RUN ln -s /etc/nginx/sites-available/default-ssl /etc/nginx/sites-enabled/default-sslWhen you run it, you'll want to make port 443 available, e.g.:
$ docker run -p 80:80 -p 443:443 -d mysite
nginx.conf
---------The nginx.conf and mime.types are pulled with slight modifications from
the h5bp Nginx HTTP server boilerplate configs project at
https://github.com/h5bp/server-configs-nginxCustomized configs
------------------To modify the NGINX config, you would just create a custom Dockerfile like the following
where you copy in your modified config files.```dockerfile
# Guide here:
# https://github.com/KyleAMathews/docker-nginx# Build docker file
# docker build -t CONTAINERNAME .# Build from this repo's image
FROM kyma/docker-nginx# Example if you wanna swap the default server file.
COPY path/to/your/default /etc/nginx/sites-enabled/default# Add src.
COPY src/ /var/wwwCMD 'nginx'
```