Skip to content

Commit 1d491ab

Browse files
committed
Added support for docker swarm
1 parent 5ac6a28 commit 1d491ab

File tree

5 files changed

+20
-10
lines changed

5 files changed

+20
-10
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ RUN openssl req -new -newkey rsa:2048 -sha1 -days 3650 -nodes -x509 -keyout
1616

1717
FROM nginx:alpine
1818
COPY . /etc/nginx/
19-
COPY --from=keys cert.key /etc/ssl/private/cert.key
20-
COPY --from=keys cert.crt /etc/ssl/certs/cert.crt
19+
COPY --from=keys cert.key /run/secrets/cert.key
20+
COPY --from=keys cert.crt /run/secrets/cert.crt

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ $ docker-compose up -d
4040

4141
Now open [https://localhost](https://localhost) in your browser!
4242

43-
By default the bundled nginx image is provided with self-signed wildcard certificate for the chosen domain name (see `.env`), so you will have to instruct your browser to trust it.
43+
By default the bundled nginx image is provided with self-signed wildcard certificate for *.localhost, so you will have to instruct your browser to trust it.
4444

4545
### Reloading
4646
To not have to restart containers each time you modify your configs, you can simply run:

boilerplate/enable/ssl.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
1212
#ssl_dhparam /etc/nginx/certs/dhparams.pem;
1313
add_header Strict-Transport-Security 'max-age=63072000; includeSubDomains; preload' always;
1414

15-
ssl_certificate /etc/ssl/certs/cert.crt;
16-
ssl_certificate_key /etc/ssl/private/cert.key;
15+
ssl_certificate /run/secrets/cert.crt;
16+
ssl_certificate_key /run/secrets/cert.key;

docker-compose.override.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '3'
1+
version: '3.1'
22
services:
33
nginx:
44
container_name: nginx
@@ -9,6 +9,5 @@ services:
99
- ./:/etc/nginx/:ro
1010

1111
fpm:
12-
restart: always
1312
container_name: fpm
14-
image: umkus/nginx-boilerplate-php
13+
restart: always

docker-compose.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
1-
version: '3'
1+
version: '3.1'
22
services:
33
nginx:
4-
hostname: ${HOST_NAME}
4+
hostname: ${HOST_NAME:-localhost}
55
image: umkus/nginx-boilerplate
66
ports:
77
- 80:80
88
- 443:443
9+
secrets:
10+
- cert.crt
11+
- cert.key
12+
fpm:
13+
image: umkus/nginx-boilerplate-php
14+
15+
secrets:
16+
cert.crt:
17+
external: true
18+
cert.key:
19+
external: true

0 commit comments

Comments
 (0)