forked from gensyn-ai/rl-swarm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.webserver
More file actions
49 lines (30 loc) · 1.1 KB
/
Dockerfile.webserver
File metadata and controls
49 lines (30 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM python:3.11 AS server
# Port the web server runs on
ENV SWARM_UI_PORT=8000
# List of peers to pair with (e.g., "/ip4/127.0.0.1/tcp/8001,/ip4/127.0.0.1/tcp/8002")
ENV INITIAL_PEERS=""
WORKDIR /app
COPY ./web/requirements.txt .
# Install wheel and upgrade pip first
RUN pip install --upgrade pip wheel setuptools
RUN pip install --no-cache-dir -r requirements.txt
RUN opentelemetry-bootstrap -a install
# Seems to be necessary with hivemind.
RUN pip install --upgrade protobuf
# OpenTelemetry environment variables
ENV OTEL_SERVICE_NAME=""
ENV OTEL_EXPORTER_OTLP_ENDPOINT=""
ENV OTEL_PYTHON_LOG_LEVEL=info
COPY ./web/api ./api
# Copies only the needed files from hivemind for the server to run.
COPY ./hivemind_exp/*_utils.py ./hivemind_exp/__init__.py ./hivemind_exp/
COPY ./hivemind_exp/contracts/*.json ./hivemind_exp/contracts/
FROM node:22 AS frontend
WORKDIR /ui
COPY web/ui/package.json web/ui/package-lock.json ./
RUN npm install
COPY web/ui ./
RUN npm run build:testnet
FROM server AS final
COPY --from=frontend /ui/dist /app/ui/dist
CMD ["opentelemetry-instrument", "python", "-m", "api.server"]