-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (46 loc) · 1.26 KB
/
Dockerfile
File metadata and controls
57 lines (46 loc) · 1.26 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
# Multi-stage build for PCQ Messenger with liboqs support
FROM ubuntu:22.04 AS builder
# Install build dependencies
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
git \
ninja-build \
libssl-dev \
python3 \
python3-pip \
python3-dev \
wget \
&& rm -rf /var/lib/apt/lists/*
# Build and install liboqs
WORKDIR /tmp
RUN git clone --depth=1 --branch=main https://github.com/open-quantum-safe/liboqs.git && \
cd liboqs && \
mkdir build && cd build && \
cmake -GNinja -DCMAKE_INSTALL_PREFIX=/usr/local .. && \
ninja && \
ninja install
# Install liboqs-python
RUN pip3 install liboqs-python
# Final stage
FROM ubuntu:22.04
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
libssl3 \
&& rm -rf /var/lib/apt/lists/*
# Copy liboqs from builder
COPY --from=builder /usr/local/lib/liboqs.so* /usr/local/lib/
COPY --from=builder /usr/local/include/oqs /usr/local/include/oqs
RUN ldconfig
# Set working directory
WORKDIR /app
# Copy application files
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt
COPY . .
# Expose ports
EXPOSE 8080 9090 5000
# Default command (can be overridden)
CMD ["python3", "-m", "app.server"]