Skip to content

Commit

Permalink
Prepare for letsencrypt container.
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvandescheur committed Oct 1, 2018
1 parent 2b12684 commit a0cb89e
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ services:
data:
build: ./
hostname: app1.svenv.nl
letsencrypt:
depends_on:
- data
image: svenv/letsencrypt
restart: always
volumes_from:
- data
postgresql:
depends_on:
- data
Expand Down
2 changes: 1 addition & 1 deletion files/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ chown -R app:app /srv/nginx/


# Execute command
exec "$@"
exec "$@"
21 changes: 14 additions & 7 deletions files/etc/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,24 @@ upstream django {


server {
listen 80 default_server;
listen 80;
root /srv/nginx;
server_name svenv.nl www.svenv.nl;

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
location /.well-known {
root /srv/nginx;
}

gzip on;
gzip_min_length 1000;
gzip_proxied any;
gzip_types *;
location / {
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;

return 301 https://svenv.nl$request_uri;
gzip on;
gzip_min_length 1000;
gzip_proxied any;
gzip_types *;

return 301 https://svenv.nl$request_uri;
}
}


Expand Down
1 change: 0 additions & 1 deletion files/etc/ssl/certs/_dhparams.pem

This file was deleted.

4 changes: 2 additions & 2 deletions files/usr/local/bin/createcertlinks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@


# Link certificates
hostname=`hostname`
hostname=svenv.nl
dir=`ls -t /etc/letsencrypt/live/ | grep $hostname | head -n 1`
path="/etc/letsencrypt/live/$dir"

rm -f /etc/ssl/certs/svenv.nl.crt
rm -f /etc/ssl/certs/svenv.nl.key

ln -s "$path/privkey.pem" "/etc/ssl/certs/svenv.nl.key"
ln -s "$path/fullchain.pem" "/etc/ssl/certs/svenv.nl.crt"
ln -s "$path/fullchain.pem" "/etc/ssl/certs/svenv.nl.crt"

0 comments on commit a0cb89e

Please sign in to comment.