Improve Dockerfile build times
Browse files- Dockerfile +19 -8
Dockerfile
CHANGED
@@ -1,22 +1,33 @@
|
|
1 |
FROM node:22-bookworm-slim
|
2 |
|
3 |
RUN apt-get update && \
|
4 |
-
apt-get install -y
|
|
|
|
|
|
|
5 |
apt-get clean && \
|
6 |
rm -rf /var/lib/apt/lists/*
|
7 |
|
8 |
USER node
|
9 |
ENV HOME=/home/node \
|
10 |
-
|
11 |
-
|
12 |
-
|
|
|
13 |
WORKDIR $HOME/app
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
COPY --chown=node hardhat hardhat
|
19 |
WORKDIR $HOME/app/hardhat
|
|
|
|
|
20 |
RUN npm install && \
|
21 |
npx hardhat compile && \
|
22 |
rm -rf contracts test cache
|
@@ -24,6 +35,6 @@ RUN npm install && \
|
|
24 |
WORKDIR $HOME/app
|
25 |
COPY --chown=node api .
|
26 |
COPY --chown=node init_tasks.py ./
|
27 |
-
ENV HF_DATASET=braindao/solbench-humaneval-for-solidity-v2
|
28 |
|
29 |
ENTRYPOINT ["./scripts/start-api.sh"]
|
|
|
1 |
FROM node:22-bookworm-slim
|
2 |
|
3 |
RUN apt-get update && \
|
4 |
+
apt-get install -y \
|
5 |
+
build-essential \
|
6 |
+
python3 \
|
7 |
+
python3-pip && \
|
8 |
apt-get clean && \
|
9 |
rm -rf /var/lib/apt/lists/*
|
10 |
|
11 |
USER node
|
12 |
ENV HOME=/home/node \
|
13 |
+
PATH=/home/node/.local/bin:$PATH
|
14 |
+
|
15 |
+
# Copy only the requirements.txt first to leverage Docker cache
|
16 |
+
COPY --chown=node requirements.txt $HOME/app/
|
17 |
WORKDIR $HOME/app
|
18 |
+
|
19 |
+
# Install Python dependencies
|
20 |
+
RUN pip install --no-cache-dir \
|
21 |
+
--break-system-packages \
|
22 |
+
-U pip && \
|
23 |
+
pip install --no-cache-dir \
|
24 |
+
--break-system-packages \
|
25 |
+
-r requirements.txt
|
26 |
|
27 |
COPY --chown=node hardhat hardhat
|
28 |
WORKDIR $HOME/app/hardhat
|
29 |
+
|
30 |
+
# Install Node.js dependencies and compile
|
31 |
RUN npm install && \
|
32 |
npx hardhat compile && \
|
33 |
rm -rf contracts test cache
|
|
|
35 |
WORKDIR $HOME/app
|
36 |
COPY --chown=node api .
|
37 |
COPY --chown=node init_tasks.py ./
|
38 |
+
ENV HF_DATASET='braindao/solbench-humaneval-for-solidity-v2'
|
39 |
|
40 |
ENTRYPOINT ["./scripts/start-api.sh"]
|