Skip to content

Commit

Permalink
Add dockerfile
Browse files Browse the repository at this point in the history
Signed-off-by: Travis F. Collins <[email protected]>
  • Loading branch information
tfcollins committed Jun 4, 2024
1 parent c1269c9 commit 4126ab0
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions webapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM python:3.9-slim

# Install go
RUN apt-get update && apt-get install -y \
wget \
git \
gcc \
&& rm -rf /var/lib/apt/lists/*

RUN wget https://go.dev/dl/go1.22.4.linux-amd64.tar.gz
RUN tar -C /usr/local -xzf go1.22.4.linux-amd64.tar.gz
RUN rm go1.22.4.linux-amd64.tar.gz
# Set go path
ENV PATH=$PATH:/usr/local/go/bin

# Install pyadi-jif with d2/go support
WORKDIR /jif
RUN git clone https://github.com/analogdevicesinc/pyadi-jif.git -b tfcollins/webapps
WORKDIR /jif/pyadi-jif/adijif/d2
RUN go build -buildmode=c-shared -o d2lib.so d2lib.go
WORKDIR /jif/pyadi-jif
RUN pip install -e '.[cplex]'


WORKDIR /app

COPY requirements.txt requirements.txt

RUN pip install -r requirements.txt

COPY app .

ENV PORT 8000
ENV HOST 0.0.0.0

CMD [ "sh", "-c", "streamlit run --server.port ${PORT} --server.address ${HOST} /app/main.py" ]

0 comments on commit 4126ab0

Please sign in to comment.