-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (37 loc) · 1.22 KB
/
Dockerfile
File metadata and controls
47 lines (37 loc) · 1.22 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
# Use Miniconda3 (Debian-based) to get Cling easily
FROM continuumio/miniconda3
# Install System Dependencies
RUN apt-get update && apt-get install -y \
wget \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Install Go (latest stable)
ENV GO_VERSION=1.21.6
RUN ARCH=$(dpkg --print-architecture) && \
wget https://go.dev/dl/go${GO_VERSION}.linux-${ARCH}.tar.gz && \
tar -C /usr/local -xzf go${GO_VERSION}.linux-${ARCH}.tar.gz && \
rm go${GO_VERSION}.linux-${ARCH}.tar.gz
ENV PATH=$PATH:/usr/local/go/bin
# Install Cling via Conda
# We create a specific environment or install in base. Installing in base is easier for single-purpose container.
RUN conda install -y -c conda-forge cling && \
conda clean -afy
# Set Workdir
WORKDIR /app
# Set LD_LIBRARY_PATH so Cling finds its libs at runtime
ENV LD_LIBRARY_PATH=/opt/conda/lib
# Copy Kernel Wrapper
COPY kernel ./kernel
# Copy Backend Source & Build
COPY backend ./backend
# Build the server binary
RUN cd backend && go build -o server ./cmd/server/main.go
# Runtime Configuration
ENV PORT=8080
ENV KERNEL_PATH="python3 /app/kernel/kernel_wrapper.py"
ENV CLING_PATH=/opt/conda/bin/cling
# Expose port
EXPOSE 8080
# Start the backend
CMD ["./backend/server"]