parent
e64ae7149e
commit
15f7acb331
@ -0,0 +1,27 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
iot-callback:
|
||||
build: ./iot-callback/
|
||||
container_name: iot_callback_server
|
||||
command: python3 app.py
|
||||
volumes:
|
||||
- ./iot-callback/:/app
|
||||
networks:
|
||||
- web
|
||||
ports:
|
||||
- 5002:5000
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.iot-callback.rule=Host(`iot.keydev.me`)"
|
||||
- "traefik.http.routers.iot-callback.entrypoints=web"
|
||||
- "traefik.http.routers.iot-callback.middlewares=redirect@file"
|
||||
- "traefik.http.routers.iot-callback-secured.rule=Host(`iot.keydev.me`)"
|
||||
- "traefik.http.routers.iot-callback-secured.entrypoints=web-secured"
|
||||
- "traefik.http.routers.iot-callback-secured.tls.certresolver=mytlschallenge"
|
||||
|
||||
networks:
|
||||
database_network:
|
||||
external: true
|
||||
web:
|
||||
external: true
|
@ -0,0 +1,10 @@
|
||||
FROM python:3.9-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt requirements.txt
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD ["python", "app.py"]
|
@ -0,0 +1,12 @@
|
||||
from flask import Flask, request
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route('/callback', methods=['POST'])
|
||||
def callback():
|
||||
data = request.json
|
||||
# Process the data as needed
|
||||
return 'Callback received', 200
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(host='0.0.0.0', port=5000)
|
@ -0,0 +1 @@
|
||||
Flask
|
Loading…
Reference in new issue