-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (45 loc) Β· 1.61 KB
/
Dockerfile
File metadata and controls
60 lines (45 loc) Β· 1.61 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
50
51
52
53
54
55
56
57
58
59
60
# ββ OptiHDL Docker Image ββ
# EDA environment: Yosys + Node.js (DigitalJS)
FROM ubuntu:22.04 AS base
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# ββ 1. System packages (Yosys) ββ
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.10 \
python3-pip \
git \
wget \
curl \
build-essential \
cmake \
graphviz \
xdot \
yosys \
tcl-dev \
libreadline-dev \
libffi-dev \
&& rm -rf /var/lib/apt/lists/*
RUN yosys -V
# ββ 2. Node.js 20 LTS (for yosys2digitaljs) ββ
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& rm -rf /var/lib/apt/lists/*
# Verify tools
RUN yosys -V && node -v
# ββ 3. Python environment ββ
RUN pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && \
pip3 config set global.trusted-host pypi.tuna.tsinghua.edu.cn
RUN pip3 install --no-cache-dir --upgrade pip
COPY requirements.txt /app/
RUN pip3 install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
# ββ 4. DigitalJS bridge (Node.js deps) ββ
COPY tools/package.json /app/tools/
RUN cd /app/tools && npm install --production
# ββ 5. Application ββ
COPY . /app/
RUN mkdir -p /app/models /app/data /app/logs /app/outputs /app/temp
EXPOSE 5000
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:5000/ || exit 1
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "2", "--timeout", "300", "web_app.app:create_app()"]