File size: 978 Bytes
5fe2042
 
 
11a86be
 
 
 
5fe2042
 
 
87d5707
 
11a86be
 
 
 
87d5707
11a86be
 
 
 
 
 
 
 
5fe2042
87d5707
 
11a86be
 
5fe2042
 
 
 
87d5707
 
 
11a86be
5fe2042
 
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
FROM node:22-bookworm-slim

RUN apt-get update && \
    apt-get install -y \
        build-essential \
        python3 \
        python3-pip && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

USER node
ENV HOME=/home/node \
    PATH=/home/node/.local/bin:$PATH

# Copy only the requirements.txt first to leverage Docker cache
COPY --chown=node requirements.txt $HOME/app/
WORKDIR $HOME/app

# Install Python dependencies
RUN pip install --no-cache-dir \
        --break-system-packages \
        -U pip && \
    pip install --no-cache-dir \
        --break-system-packages \
        -r requirements.txt

COPY --chown=node hardhat hardhat
WORKDIR $HOME/app/hardhat

# Install Node.js dependencies and compile
RUN npm install && \
    npx hardhat compile && \
    rm -rf contracts test cache

WORKDIR $HOME/app
COPY --chown=node api .
COPY --chown=node init_tasks.py ./
ENV HF_DATASET='braindao/solbench-humaneval-for-solidity-v2'

ENTRYPOINT ["./scripts/start-api.sh"]