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

https://github.com/gh640/docker-compose-depends_on-nginx-certs-sample

A sample that runs NGINX with a self-signed certificate
https://github.com/gh640/docker-compose-depends_on-nginx-certs-sample

docker docker-compose nginx self-signed-certificate

Last synced: about 1 month ago
JSON representation

A sample that runs NGINX with a self-signed certificate

Awesome Lists containing this project

README

          

# A sample that runs NGINX with a self-signed certificate

This is a sample Docker Compose configuration to run an NGINX server with a self-signed certificate.

## Requirements

- Docker
- Docker Compose `>=1.29.0`

## Usage

Build images and run containers.

```zsh
docker compose build
docker compose up -d
```

You can check the NGINX server runs with a self-signed certificate.

```zsh
curl --insecure \
--resolve 'example.local:443:127.0.0.1' \
https://example.local
```

```html


Hello

body {
margin: 0;
padding: 0;
font-family: sans-serif;
}
.bodywrapper {
width: 100vw;
height: 100vh;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
background-color: #f4f8f8;
}


Hello.


```

Stop containers and remove resources after you've finished.

```zsh
docker compose down
```

## References

- [Depends_on condition service_completed_successfully · Issue #8154 · docker/compose · GitHub](https://github.com/docker/compose/issues/8154)
- [Release 1.29.0 · docker/compose · GitHub](https://github.com/docker/compose/releases/tag/1.29.0)