Dockerfile
to create a NGINX container image who is SPA ready and has GZip enabled.
docker pull credija/nginx:lts
Start NGINX using:
docker run --name nginx-credija -d --restart=always \
--publish 8080:80 \
-m 256MB \
credija/nginx:lts
Also, if you want to overwrite and provide your own config file use this:
docker run --name nginx-credija -d --restart=always \
--publish 8080:80 \
-m 256MB \
--volume /opt/your-nginx.conf:/etc/nginx/nginx.conf \
credija/nginx:lts
Alternatively, you can use the sample docker-compose.yml file to start the container using Docker Compose
Point your browser to http://localhost:8080 and follow the setup procedure to complete the installation.
To upgrade to newer releases:
- Download the updated Docker image:
docker pull credija/nginx:{version}
- Stop the currently running image:
docker stop nginx-credija
- Remove the stopped container
docker rm -v nginx-credija
- Start the updated image
docker run -name nginx-credija -d \
[OPTIONS] \
credija/nginx:{version}
For debugging and maintenance purposes you may want access the containers shell. If you are using Docker version 1.3.0
or higher you can access a running containers shell by starting bash
using docker exec
:
docker exec -it nginx-credija bash