Skip to content

Commit 316ccdf

Browse files
committed
Provide default cont. Add entryppoint command to replace domain with ENV value
1 parent a4b2719 commit 316ccdf

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ services:
77
- '80:80'
88
- '443:443'
99
volumes:
10-
- ./nginx:/etc/nginx/conf.d
10+
- ./nginx/default.conf:/tmp/default.template
1111
- ./src:/var/www/html:rw,cached
1212
- ./certs:/etc/certs
1313
depends_on:
1414
- wordpress
1515
restart: always
16+
entrypoint: /bin/bash -c 'cat /tmp/default.template | sed "s/\\\$$domain/${DOMAIN}/g" > /etc/nginx/conf.d/default.conf && nginx -g "daemon off;"'
1617

1718
mysql:
1819
image: mariadb

nginx/wordpress_ssl.conf renamed to nginx/default.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ server {
1111
server {
1212
listen 443 ssl http2;
1313
listen [::]:443 ssl http2;
14-
server_name myapp.local www.myapp.local;
14+
server_name $domain www.$domain;
1515

1616
add_header Strict-Transport-Security "max-age=31536000" always;
1717

@@ -28,8 +28,8 @@ server {
2828
access_log /var/log/nginx/access.log;
2929
error_log /var/log/nginx/error.log;
3030

31-
ssl_certificate /etc/certs/myapp.local.crt;
32-
ssl_certificate_key /etc/certs/myapp.local.key;
31+
ssl_certificate /etc/certs/$domain.crt;
32+
ssl_certificate_key /etc/certs/$domain.key;
3333

3434
client_max_body_size 100M;
3535

0 commit comments

Comments
 (0)