-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: var BACKUP_SERVER to tag server as backup
- Loading branch information
Showing
3 changed files
with
64 additions
and
1 deletion.
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
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,14 @@ | ||
import pytest | ||
|
||
|
||
def test_web1_is_backup(docker_compose, nginxproxy): | ||
for i in range(1, 10): | ||
r = nginxproxy.get("http://web1.nginx-proxy.tld/port") | ||
assert r.status_code == 200 | ||
assert r.text == "answer from port 91\n" | ||
|
||
def test_web2_is_production(docker_compose, nginxproxy): | ||
for i in range(1, 10): | ||
r = nginxproxy.get("http://web2.nginx-proxy.tld/port") | ||
assert r.status_code == 200 | ||
assert r.text == "answer from port 82\n" |
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,44 @@ | ||
version: "2" | ||
|
||
services: | ||
web1: | ||
image: web | ||
expose: | ||
- "81" | ||
environment: | ||
WEB_PORTS: 81 | ||
VIRTUAL_HOST: web1.nginx-proxy.tld | ||
network_mode: "none" | ||
|
||
web1_backup: | ||
image: web | ||
expose: | ||
- "91" | ||
environment: | ||
WEB_PORTS: 91 | ||
VIRTUAL_HOST: web1.nginx-proxy.tld | ||
BACKUP_SERVER: "true" | ||
|
||
web2: | ||
image: web | ||
expose: | ||
- "82" | ||
environment: | ||
WEB_PORTS: 82 | ||
VIRTUAL_HOST: web2.nginx-proxy.tld | ||
|
||
web2_backup: | ||
image: web | ||
expose: | ||
- "92" | ||
environment: | ||
WEB_PORTS: 92 | ||
VIRTUAL_HOST: web2.nginx-proxy.tld | ||
BACKUP_SERVER: "true" | ||
|
||
sut: | ||
image: nginxproxy/nginx-proxy:test | ||
volumes: | ||
- /var/run/docker.sock:/tmp/docker.sock:ro | ||
environment: | ||
HTTPS_METHOD: nohttps |