Compare commits
No commits in common. "5d6138bdc27df59afaff72bd8a67e32a152cde53" and "564e449e3300a976daadc963cbeac5cce5e48e8e" have entirely different histories.
5d6138bdc2
...
564e449e33
23
Dockerfile
23
Dockerfile
@ -1,23 +0,0 @@
|
|||||||
FROM python:3.13-slim-bookworm AS build
|
|
||||||
|
|
||||||
WORKDIR /santa
|
|
||||||
RUN mkdir -p /santa/WebServer/static
|
|
||||||
COPY setup-server.sh /santa/setup-server.sh
|
|
||||||
RUN apt-get update && apt-get install -y curl bzip2
|
|
||||||
RUN /santa/setup-server.sh --download-only
|
|
||||||
COPY requirements.txt /santa/requirements.txt
|
|
||||||
COPY src/setup.py /santa/src/setup.py
|
|
||||||
COPY src/SantaExchange/ /santa/src/SantaExchange/
|
|
||||||
RUN pip install -r /santa/requirements.txt
|
|
||||||
RUN /santa/setup-server.sh
|
|
||||||
|
|
||||||
FROM python:3.13-slim-bookworm
|
|
||||||
RUN pip install flask flask-socketio gunicorn eventlet
|
|
||||||
COPY --from=build /santa/WebServer /WebServer
|
|
||||||
COPY WebServer/__init__.py WebServer/server.py /WebServer/
|
|
||||||
COPY WebServer/templates/ /WebServer/templates/
|
|
||||||
COPY WebServer/static/exchange_client.py WebServer/static/exchange_worker.js WebServer/static/style.css /WebServer/static/
|
|
||||||
|
|
||||||
WORKDIR /WebServer
|
|
||||||
EXPOSE 8000
|
|
||||||
CMD ["gunicorn", "--worker-class", "eventlet", "-w", "1", "--bind", "0.0.0.0:8000", "server:app"]
|
|
||||||
@ -1,13 +1,11 @@
|
|||||||
import os
|
import json
|
||||||
|
from collections import defaultdict
|
||||||
|
|
||||||
from flask import Flask, render_template
|
from flask import Flask, render_template
|
||||||
from flask_socketio import SocketIO, join_room, leave_room, send
|
from flask_socketio import SocketIO, join_room, leave_room, send
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
if 'CORS_ORIGIN' in os.environ and os.environ['CORS_ORIGIN'] is not None:
|
socketio = SocketIO(app)
|
||||||
socketio = SocketIO(app, cors_allowed_origins=[os.environ['CORS_ORIGIN']])
|
|
||||||
else:
|
|
||||||
socketio = SocketIO(app)
|
|
||||||
|
|
||||||
if __name__ == 'main':
|
if __name__ == 'main':
|
||||||
socketio.run(app)
|
socketio.run(app)
|
||||||
|
|||||||
@ -17,10 +17,6 @@ if ! test -f ./WebServer/static/socket.io.min.js; then
|
|||||||
fi
|
fi
|
||||||
echo "Socket.io is installed"
|
echo "Socket.io is installed"
|
||||||
|
|
||||||
if [[ "$1" == "--download-only" ]]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Building wheel file of SantaExchange package"
|
echo "Building wheel file of SantaExchange package"
|
||||||
cd src/
|
cd src/
|
||||||
python setup.py bdist_wheel
|
python setup.py bdist_wheel
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user