APEX-Core-Node / DOCKER
UPNISO's picture
Update DOCKER
842f5e2 verified
Raw History Blame Contribute Delete
1.09 kB
# Use a Base Image with Python
FROM python:3.10-slim
# Install System Dependencies (C++ Compiler & Go)
RUN apt-get update && apt-get install -y \
g++ \
wget \
git \
&& rm -rf /var/lib/apt/lists/*
# Install Go (Golang 1.21)
RUN wget https://go.dev/dl/go1.21.6.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go1.21.6.linux-amd64.tar.gz && \
rm go1.21.6.linux-amd64.tar.gz
ENV PATH="/usr/local/go/bin:${PATH}"
# Set Working Directory
WORKDIR /app
# Copy Requirements and Install Python Libs
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the code
COPY . .
# Compile the C++ Engine
RUN g++ -o apex_engine engine.cpp
# Initialize Go Module and Build
RUN go mod init apex_coin && go mod tidy && go build -o apex_ledger main.go
# Make the start script executable
RUN chmod +x start.sh
# Open the Port for HF Spaces
EXPOSE 7860
WORKDIR /app
COPY . .
RUN pip install --no-cache-dir -r requirements.txt
# Hugging Face requires port 7860
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]