Skip to content

Commit e1685e6

Browse files
Add Traefik
1 parent 3087e26 commit e1685e6

File tree

3 files changed

+60
-5
lines changed

3 files changed

+60
-5
lines changed

mock-server/app/http.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,9 +673,8 @@
673673
->inject('error')
674674
->inject('request')
675675
->inject('response')
676-
->inject('logger')
677676
->action(
678-
function ($utopia, $error, $request, $response, $logger) {
677+
function ($utopia, $error, $request, $response) {
679678
$route = $utopia->match($request);
680679

681680
$code = $error->getCode();

mock-server/docker-compose.yml

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
11
version: '3'
22

33
services:
4+
traefik:
5+
image: traefik:2.9
6+
container_name: appwrite-traefik
7+
command:
8+
- --log.level=DEBUG
9+
- --api.insecure=true
10+
- --providers.file.directory=/storage/config
11+
- --providers.file.watch=true
12+
- --providers.docker=true
13+
- --providers.docker.exposedByDefault=false
14+
- --providers.docker.constraints=Label(`traefik.constraint-label-stack`,`mock_api`)
15+
- --entrypoints.mock_web.address=:80
16+
- --entrypoints.mock_websecure.address=:443
17+
- --accesslog=true
18+
ports:
19+
- 80:80
20+
- 8080:80
21+
- 443:443
22+
- 9500:8080
23+
volumes:
24+
- /var/run/docker.sock:/var/run/docker.sock
25+
- mock-config:/storage/config:ro
26+
- mock-certificates:/storage/certificates:ro
27+
depends_on:
28+
- mockapi
29+
networks:
30+
- gateway
31+
- mockapi
32+
433
mockapi:
534
container_name: mockapi
635
build:
@@ -16,4 +45,31 @@ services:
1645
volumes:
1746
- ./app:/usr/src/code/app
1847
- ./src:/usr/src/code/src
19-
- ./vendor:/usr/src/code/vendor
48+
- ./vendor:/usr/src/code/vendor
49+
labels:
50+
- "traefik.enable=true"
51+
- "traefik.constraint-label-stack=mock_api"
52+
- "traefik.docker.network=mockapi"
53+
- "traefik.http.services.mock_api.loadbalancer.server.port=80"
54+
#http
55+
- traefik.http.routers.mock_api_http.entrypoints=mock_web
56+
- traefik.http.routers.mock_api_http.rule=PathPrefix(`/`)
57+
- traefik.http.routers.mock_api_http.service=mock_api
58+
# https
59+
- traefik.http.routers.mock_api_https.entrypoints=mock_websecure
60+
- traefik.http.routers.mock_api_https.rule=PathPrefix(`/`)
61+
- traefik.http.routers.mock_api_https.service=mock_api
62+
- traefik.http.routers.mock_api_https.tls=true
63+
networks:
64+
- mockapi
65+
66+
volumes:
67+
mock-certificates:
68+
mock-config:
69+
70+
networks:
71+
mockapi:
72+
name: mockapi
73+
gateway:
74+
name: gateway
75+

tests/resources/spec.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"url": "https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE"
1616
}
1717
},
18-
"host": "stage.appwrite.io",
18+
"host": "localhost",
1919
"basePath": "/v1",
20-
"schemes": ["https"],
20+
"schemes": ["http"],
2121
"consumes": ["application/json", "multipart/form-data"],
2222
"produces": ["application/json"],
2323
"securityDefinitions": {

0 commit comments

Comments
 (0)