-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
47 lines (36 loc) · 1.1 KB
/
Dockerfile
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
FROM python:3.12-slim as builder
WORKDIR /app
# Install build dependencies including curl
RUN apt-get update && apt-get install -y \
git \
gcc \
g++ \
python3-dev \
make \
cmake \
curl \
&& rm -rf /var/lib/apt/lists/*
COPY ./src ./src
COPY ./main.py ./main.py
COPY ./pyproject.toml ./pyproject.toml
COPY ./mq_files/linux ./mq_files/linux
COPY ./requirements.txt ./requirements.txt
RUN mkdir -p /opt/mqm
RUN cp -r ./mq_files/linux/* /opt/mqm/
# Fix for LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH=/app/mq_files/linux/lib64:/opt/mqm/lib64
# Download and install dependencies
RUN pip install --upgrade pip && \
pip install wheel && \
pip install -r requirements.txt
FROM python:3.12-slim
WORKDIR /app
ENV LD_LIBRARY_PATH=/app/mq_files/linux/lib64:/opt/mqm/lib64
# Copy only necessary files from builder
COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
COPY --from=builder /opt/mqm /opt/mqm
COPY ./src ./src
COPY ./main.py ./main.py
COPY ./pyproject.toml ./pyproject.toml
COPY ./mq_files/linux ./mq_files/linux
CMD ["python", "main.py"]