Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions examples/cache/Dockerfile-service
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
FROM envoyproxy/envoy-alpine-dev:latest
FROM alpine:latest

RUN apk update && apk add py3-pip bash curl
RUN pip3 install -q Flask==0.11.1 requests==2.18.4 pyyaml
RUN apk update && apk add py3-pip
RUN pip3 install -q Flask==0.11.1 pyyaml
RUN mkdir /code
COPY ./start_service.sh /usr/local/bin/start_service.sh
COPY ./service-envoy.yaml /etc/service-envoy.yaml
COPY ./service.py /code
RUN chmod u+x /usr/local/bin/start_service.sh
ENTRYPOINT /usr/local/bin/start_service.sh
CMD ["python3", "/code/service.py"]
9 changes: 0 additions & 9 deletions examples/cache/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ services:
build:
context: .
dockerfile: Dockerfile-frontenvoy
networks:
- envoymesh
ports:
- "8000:8000"

Expand All @@ -16,8 +14,6 @@ services:
dockerfile: Dockerfile-service
volumes:
- ./responses.yaml:/etc/responses.yaml
networks:
- envoymesh
environment:
- SERVICE_NAME=1

Expand All @@ -27,10 +23,5 @@ services:
dockerfile: Dockerfile-service
volumes:
- ./responses.yaml:/etc/responses.yaml
networks:
- envoymesh
environment:
- SERVICE_NAME=2

networks:
envoymesh: {}
45 changes: 0 additions & 45 deletions examples/cache/service-envoy.yaml

This file was deleted.

7 changes: 2 additions & 5 deletions examples/cache/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
from flask import make_response, abort
import yaml
import os
import requests
import socket
import sys
import datetime

app = Flask(__name__)


@app.route('/service/<service_number>/<response_id>')
def get(service_number, response_id):
stored_response = yaml.load(open('/etc/responses.yaml', 'r')).get(response_id)
stored_response = yaml.safe_load(open('/etc/responses.yaml', 'r')).get(response_id)

if stored_response is None:
abort(404, 'No response found with the given id')
Expand Down Expand Up @@ -41,4 +38,4 @@ def get(service_number, response_id):
if not os.path.isfile('/etc/responses.yaml'):
print('Responses file not found at /etc/responses.yaml')
exit(1)
app.run(host='127.0.0.1', port=8080, debug=True)
app.run(host='0.0.0.0', port=8000, debug=True)
3 changes: 0 additions & 3 deletions examples/cache/start_service.sh

This file was deleted.

9 changes: 4 additions & 5 deletions examples/cors/backend/Dockerfile-service
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
FROM envoyproxy/envoy-alpine-dev:latest
FROM alpine:latest

RUN apk update && apk add py3-pip bash
RUN apk update && apk add py3-pip
RUN pip3 install -q Flask==0.11.1
RUN mkdir /code
ADD ./service.py /code/
ADD ./start_service.sh /usr/local/bin/start_service.sh
RUN chmod u+x /usr/local/bin/start_service.sh
ENTRYPOINT ["/bin/sh", "/usr/local/bin/start_service.sh"]

CMD ["python3", "/code/service.py"]
11 changes: 0 additions & 11 deletions examples/cors/backend/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ services:
build:
context: .
dockerfile: Dockerfile-frontenvoy
networks:
- envoymesh
ports:
- "8002:8000"
- "8003:8001"
Expand All @@ -15,12 +13,3 @@ services:
build:
context: .
dockerfile: Dockerfile-service
volumes:
- ./service-envoy.yaml:/etc/service-envoy.yaml
networks:
envoymesh:
aliases:
- backendservice

networks:
envoymesh: {}
2 changes: 1 addition & 1 deletion examples/cors/backend/front-envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static_resources:
- endpoint:
address:
socket_address:
address: backendservice
address: backend-service
port_value: 8000

admin:
Expand Down
45 changes: 0 additions & 45 deletions examples/cors/backend/service-envoy.yaml

This file was deleted.

5 changes: 2 additions & 3 deletions examples/cors/backend/service.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from flask import Flask, request, send_from_directory
import os
from flask import Flask

app = Flask(__name__)

Expand All @@ -10,4 +9,4 @@ def cors_enabled(status):


if __name__ == "__main__":
app.run(host='127.0.0.1', port=8080, debug=True)
app.run(host='0.0.0.0', port=8000)
3 changes: 0 additions & 3 deletions examples/cors/backend/start_service.sh

This file was deleted.

9 changes: 4 additions & 5 deletions examples/cors/frontend/Dockerfile-service
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
FROM envoyproxy/envoy-alpine-dev:latest
FROM alpine:latest

RUN apk update && apk add py3-pip bash
RUN apk update && apk add py3-pip
RUN pip3 install -q Flask==0.11.1
RUN mkdir /code
ADD ./service.py ./index.html /code/
ADD ./start_service.sh /usr/local/bin/start_service.sh
RUN chmod u+x /usr/local/bin/start_service.sh
ENTRYPOINT ["/bin/sh", "/usr/local/bin/start_service.sh"]

CMD ["python3", "/code/service.py"]
11 changes: 0 additions & 11 deletions examples/cors/frontend/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,10 @@ services:
build:
context: .
dockerfile: Dockerfile-frontenvoy
networks:
- envoymesh
ports:
- "8000:8000"

frontend-service:
build:
context: .
dockerfile: Dockerfile-service
volumes:
- ./service-envoy.yaml:/etc/service-envoy.yaml
networks:
envoymesh:
aliases:
- frontendservice

networks:
envoymesh: {}
2 changes: 1 addition & 1 deletion examples/cors/frontend/front-envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ static_resources:
- endpoint:
address:
socket_address:
address: frontendservice
address: frontend-service
port_value: 8000
45 changes: 0 additions & 45 deletions examples/cors/frontend/service-envoy.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion examples/cors/frontend/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ def index():


if __name__ == "__main__":
app.run(host='127.0.0.1', port=8080, debug=True)
app.run(host='0.0.0.0', port=8000, debug=True)
3 changes: 0 additions & 3 deletions examples/cors/frontend/start_service.sh

This file was deleted.

8 changes: 3 additions & 5 deletions examples/csrf/crosssite/Dockerfile-service
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
FROM envoyproxy/envoy-alpine-dev:latest
FROM alpine:latest

RUN apk update && apk add py3-pip bash
RUN apk update && apk add py3-pip
RUN pip3 install -q Flask==0.11.1
RUN mkdir /code
ADD ./crosssite/service.py ./index.html /code/
ADD ./start_service.sh /usr/local/bin/start_service.sh
RUN chmod u+x /usr/local/bin/start_service.sh
ENTRYPOINT ["/bin/sh", "/usr/local/bin/start_service.sh"]
CMD ["python3", "/code/service.py"]
9 changes: 0 additions & 9 deletions examples/csrf/crosssite/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,10 @@ services:
build:
context: .
dockerfile: Dockerfile-frontenvoy
networks:
- envoymesh
ports:
- "8002:8000"

service:
build:
context: ..
dockerfile: crosssite/Dockerfile-service
volumes:
- ../service-envoy.yaml:/etc/service-envoy.yaml
networks:
- envoymesh

networks:
envoymesh: {}
2 changes: 1 addition & 1 deletion examples/csrf/crosssite/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ def index():


if __name__ == "__main__":
app.run(host='127.0.0.1', port=8080, debug=True)
app.run(host='0.0.0.0', port=8000)
8 changes: 3 additions & 5 deletions examples/csrf/samesite/Dockerfile-service
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
FROM envoyproxy/envoy-alpine-dev:latest
FROM alpine:latest

RUN apk update && apk add py3-pip bash
RUN apk update && apk add py3-pip
RUN pip3 install -q Flask==0.11.1
RUN mkdir /code
ADD ./samesite/service.py ./index.html /code/
ADD ./start_service.sh /usr/local/bin/start_service.sh
RUN chmod u+x /usr/local/bin/start_service.sh
ENTRYPOINT ["/bin/sh", "/usr/local/bin/start_service.sh"]
CMD ["python3", "/code/service.py"]
9 changes: 0 additions & 9 deletions examples/csrf/samesite/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ services:
build:
context: .
dockerfile: Dockerfile-frontenvoy
networks:
- envoymesh
ports:
- "8000:8000"
- "8001:8001"
Expand All @@ -15,10 +13,3 @@ services:
build:
context: ..
dockerfile: samesite/Dockerfile-service
volumes:
- ../service-envoy.yaml:/etc/service-envoy.yaml
networks:
- envoymesh

networks:
envoymesh: {}
Loading