-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
30b282c
commit 56e0f84
Showing
6 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# duck.local | ||
|
||
Configure a local instance of Duck using Docker Compose, systemd, and Nginx. | ||
|
||
## Disclaimer | ||
|
||
No warranty expressed or implied. Code is provided as is. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
tag=$(get_octopusvariable "Project.Duck.ServerTag") | ||
|
||
echo "Stop duck-local." | ||
systemctl is-active --quiet jenkins-local && systemctl stop jenkins-local | ||
|
||
docker-compose down | ||
|
||
if [ ! -d "data" ]; then | ||
echo "Create data folder." | ||
mkdir data | ||
fi | ||
|
||
docker-compose pull | ||
docker-compose up -d | ||
|
||
mv duck.json data/ | ||
mv duck-local.service /etc/systemd/system | ||
mv duck.local /etc/nginx/sites-available | ||
|
||
if [ ! -e "/etc/nginx/sites-enabled/duck.local" ]; then | ||
echo "Create /etc/nginx/sites-enabled/duck.local." | ||
ln -s /etc/nginx/sites-available/duck.local /etc/nginx/sites-enabled/duck.local | ||
fi | ||
|
||
echo "Start duck-local." | ||
systemctl is-enabled --quiet duck-local || systemctl enable duck-local | ||
systemctl start duck-local | ||
echo "Reload systemctl daemon." | ||
systemctl daemon-reload | ||
echo "Restart nginx." | ||
systemctl restart nginx | ||
|
||
write_highlight "[duck.local](https://duck.local)" | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: "3" | ||
services: | ||
duck: | ||
image: docker.io/duckhq/duck:latest | ||
ports: | ||
- "8085:15825" | ||
volumes: | ||
- "./data:/data" | ||
container_name: duck | ||
command: ["start", "--config", "/data/duck.json"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=#{Project.Duck.ServiceDescription} | ||
Requires=docker.service | ||
After=docker.service | ||
|
||
[Service] | ||
WorkingDirectory=#{Project.Duck.InstallLocation} | ||
ExecStart=/usr/bin/docker-compose up | ||
ExecStop=/usr/bin/docker-compose stop | ||
TimeoutStartSec=0 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/duckhq/duck/master/schemas/v0.14.json", | ||
"interval": 30, | ||
"views": [], | ||
"collectors": [], | ||
"observers": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
server { | ||
listen 443 ssl; | ||
|
||
ssl_certificate /etc/ssl/duck.crt; | ||
ssl_certificate_key /etc/ssl/duck.key; | ||
ssl_session_cache shared:SSL:20m; | ||
ssl_session_timeout 180m; | ||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | ||
add_header Strict-Transport-Security "max-age=31536000" always; | ||
|
||
server_name duck.local; | ||
|
||
location / { | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
|
||
proxy_pass http://127.0.0.1:#{Project.duck.Port}; | ||
} | ||
} |