An open API service indexing awesome lists of open source software.

https://github.com/nwtgck/self-signed-https-docker

Docker image which enables your site with self-signed HTTPS easily
https://github.com/nwtgck/self-signed-https-docker

docker https nginx reverse-proxy

Last synced: 10 months ago
JSON representation

Docker image which enables your site with self-signed HTTPS easily

Awesome Lists containing this project

README

          

# self-signed-https
[![Docker Automated build](https://img.shields.io/docker/automated/nwtgck/self-signed-https.svg)](https://hub.docker.com/r/nwtgck/self-signed-https/) [![](https://images.microbadger.com/badges/image/nwtgck/self-signed-https.svg)](https://microbadger.com/images/nwtgck/self-signed-https "Get your own image badge on microbadger.com")

Docker image which enables your site with self-signed HTTPS easily

![Ghost Self-signed HTTPS Docker](demo_images/ghost.gif)

## Quick Start

Suppose http://localhost:8181/ is running. The following command runs a HTTPS server on port 8080.
```bash
docker run -p 8080:80 -p 4443:443 -it -e TARGET_HOST=localhost -e TARGET_PORT=3000 nwtgck/self-signed-https
```

## Docker Compose

Here is an example `docker-compose.yml`.

In the example, self-signed HTTPS server is running on .

```yaml
version: '3.1'
services:
self-signed-https:
image: nwtgck/self-signed-https:v0.1.0
ports:
- '8080:80'
- '4443:443'
depends_on:
- ghost
restart: always
environment:
TARGET_HOST: ghost
TARGET_PORT: 2368
volumes:
- ./docker_volumes/ssl_certs:/ssl_certs

ghost:
image: ghost
restart: always
expose:
- "2368"
```
(from: [compose-examples/ghost/docker-compose.yml](compose-examples/ghost/docker-compose.yml))

### Data Persistence

The following files are located at `./docker_volumes/ssl_cert` in the above example.

* `server.key`
* `server.csr`
* `server.crt`

## Environment Variables

| name | description | required or default value |
|-------------------|----------------------------------------|---------------------------|
| TARGET_HOST | Host of destination | REQUIRED |
| TARGET_PORT | HTTP port of destination | `80` |
| SERVER_HTTP_PORT | HTTP port of Self-signed HTTPS server | `80` |
| SERVER_HTTPS_PORT | HTTPS port of Self-signed HTTPS server | `443` |