Tejas Badadare hace 9 meses
padre
commit
1e7c7b6f2a

+ 33 - 0
apps/contract-deployer/Dockerfile

@@ -0,0 +1,33 @@
+# Use Node.js as base image since we need both Node.js and Python
+FROM node:22-bullseye-slim
+
+# Install Python and other system dependencies
+RUN apt-get update && apt-get install -y \
+    python3 \
+    python3-pip \
+    git \
+    && rm -rf /var/lib/apt/lists/*
+
+# Install specific pnpm version
+RUN npm install -g pnpm@9.15.3
+
+WORKDIR /app
+
+# Copy the entire monorepo
+COPY . .
+
+# Install dependencies and build the monorepo
+RUN pnpm install
+
+# Install uv and Python dependencies
+RUN curl -LsSf https://astral.sh/uv/install.sh | sh
+RUN uv pip install --no-cache -r apps/contract-deployer/requirements.txt
+
+# Set working directory to the contract-deployer app
+WORKDIR /app/apps/contract-deployer
+
+# Expose the port Streamlit runs on
+EXPOSE 8501
+
+# Command to run the application
+CMD ["uvx", "streamlit", "run", "server.py", "--server.address", "0.0.0.0"]

+ 1 - 1
apps/contract-deployer/README.md

@@ -1,4 +1,4 @@
 # Contract Deployer
 
 Currently only EVM chains are supported.
-Run the webapp with: `uvx streamlit run server.py`
+Install uv, then run the webapp with: `uvx streamlit run server.py`

+ 13 - 0
apps/contract-deployer/docker-compose.yaml

@@ -0,0 +1,13 @@
+services:
+  contract-deployer:
+    build:
+      context: ../../ # Build context is set to the root of the monorepo
+      dockerfile: apps/contract-deployer/Dockerfile
+    ports:
+      - "8501:8501"
+    volumes:
+      - ../../:/app # Mount the entire monorepo. TODO: pull from GH
+    environment:
+      - STREAMLIT_SERVER_PORT=8501
+      - STREAMLIT_SERVER_ADDRESS=0.0.0.0
+    restart: unless-stopped