https://github.com/mathiasgruber/nginx-local-ssl
Docker image for nginx set up with SSL for localhost
https://github.com/mathiasgruber/nginx-local-ssl
Last synced: 3 months ago
JSON representation
Docker image for nginx set up with SSL for localhost
- Host: GitHub
- URL: https://github.com/mathiasgruber/nginx-local-ssl
- Owner: MathiasGruber
- License: mit
- Created: 2020-08-25T03:27:16.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-06-10T13:18:34.000Z (about 3 years ago)
- Last Synced: 2025-04-02T04:01:40.870Z (3 months ago)
- Language: Dockerfile
- Size: 3.91 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nginx-local-ssl
Docker image for nginx set up with SSL for localhost# Use in docker compose
Typically I use this image in docker-compose as an nginx proxy as follows```
nginx:
container_name: nginx
image: nanomathias/nginx-local-ssl
ports:
- "${NGINX_PORT}:${NGINX_PORT}"
volumes:
- ../nginx/template.conf:/etc/nginx/conf.d/mysite.template:ro
environment:
# Used in base.conf to retain normal env variables
# see: https://serverfault.com/questions/577370/how-can-i-use-environment-variables-in-nginx-conf
- DOLLAR=$$
env_file:
- .env
# Insert env variables,
# see: https://serverfault.com/questions/577370/how-can-i-use-environment-variables-in-nginx-conf
command: sh -c "echo 'Substituting env vars, and starting nginx' &&
envsubst < /etc/nginx/conf.d/mysite.template > /etc/nginx/conf.d/default.conf &&
exec nginx -g 'daemon off;'"
```# Build locally
```
# Setup docker builder
docker buildx create --name mybuilder --driver-opt network=host --use# Build docker image (multi-arch version)
docker buildx build \
--push \
--tag nanomathias/nginx-local-ssl:release-1.0.1 \
--platform linux/amd64,linux/arm64 .
```