-
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.
feat: now using traefik proxy for true zero downtime
- Loading branch information
Showing
30 changed files
with
557 additions
and
95 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 |
---|---|---|
@@ -1,8 +1,16 @@ | ||
# uncomment in your prod env to make the repo update itself: | ||
# PYTHON_ENV=production | ||
|
||
# comment out in your prod env to get production certs: | ||
LE_STAGING=1 | ||
# Trusted ips for proxy protocol, usually the ip of your router (sending to traefik) | ||
TRUSTED_IPS_CIDR=192.168.0.0/24 | ||
|
||
# Traefik dashboard domain name | ||
TRAEFIK_DOMAIN=traefik.example.com | ||
# Traefic basic auth user+pass (htpasswd) WHICH NEEDS TO BE QUOTED! | ||
# TRAEFIK_ADMIN='admin:$xxx/yyy' | ||
|
||
# Uncomment next line for prod certs | ||
TRAEFIK_CERTIFICATESRESOLVERS_LETSENCRYPT_ACME_CASERVER=https://acme-staging-v02.api.letsencrypt.org/directory | ||
TRAEFIK_CERTIFICATESRESOLVERS_LETSENCRYPT_ACME_EMAIL=mail@example.com | ||
|
||
# LE_EMAIL=you@gmail.com | ||
# API_KEY=your_api_key |
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 |
---|---|---|
|
@@ -5,5 +5,6 @@ __pycache__ | |
.venv | ||
certs/* | ||
db.yml | ||
proxy/*.conf | ||
proxy/nginx/*.conf | ||
proxy/traefik/*.yml | ||
upstream |
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
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/usr/bin/env sh | ||
. .venv/bin/activate | ||
|
||
kill $(fuser 8888/tcp 2>/dev/null | awk '{ print $1 }') | ||
kill $(fuser 8888/tcp 2>/dev/null | awk '{ print $1 }') 2>/dev/null | ||
|
||
PYTHONPATH=. python api/main.py main:app >logs/error.log 2>&1 & |
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
Empty file.
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
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
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
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
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
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
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
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,17 @@ | ||
import http from 'k6/http'; | ||
import { check, sleep } from 'k6'; | ||
|
||
export const options = { | ||
insecureSkipTLSVerify: true, | ||
stages: [ | ||
// { duration: '30s', target: 20 }, | ||
{ duration: '0m20s', target: 1 }, | ||
// { duration: '20s', target: 20 }, | ||
], | ||
}; | ||
|
||
export default function () { | ||
const res = http.get(`https://hello.srv.instrukt.ai`); | ||
check(res, { 'status was 200': (r) => r.status == 200 }); | ||
sleep(1); | ||
} |
Oops, something went wrong.