Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (45 loc) · 1.64 KB
/
Copy pathDockerfile
File metadata and controls
55 lines (45 loc) · 1.64 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
# Use the official lightweight Python image.
# https://hub.docker.com/_/python
FROM python:3.15.2-slim-trixie
# Allow statements and log messages to immediately appear in the logs
ENV PYTHONUNBUFFERED True
# Don't create .pyc files
ENV PYTHONDONTWRITEBYTECODE True
# Put our application on the PYTHONPATH
ENV PYTHONPATH /app
# Define whether we're building a production or a development image. This will
# generally be used to control whether or not we install our development and
# test dependencies.
ARG DEVEL=no
# Install System level requirements, this is done before everything else
# because these are rarely ever going to change.
RUN set -x \
&& apt-get update \
&& apt-get install -y \
git cmake g++ \
# $(if [ "$DEVEL" = "yes" ]; then echo 'bash postgresql-client'; fi) \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install pycdc...
WORKDIR /tmp
RUN git init pycdc && \
cd pycdc && \
git fetch --depth 1 "https://github.com/zrax/pycdc.git" b4289760970dbc399684f1e155ec6d1ea1cc787e && \
git checkout FETCH_HEAD && \
cmake . && \
cmake --build . --config release && \
mv ./pycdc /usr/local/bin && \
cd .. && rm -rf ./pycdc
# Copy local code to the container image.
WORKDIR /app
# Copy in requirements files
COPY ./requirements ./requirements
# Install production dependencies.
RUN pip install \
-r requirements/main.txt \
-r requirements/deploy.txt
# Install development dependencies
RUN if [ "$DEVEL" = "yes" ]; then pip install -r requirements/lint.txt; fi
RUN if [ "$DEVEL" = "yes" ]; then pip install -r requirements/tests.txt; fi
# Copy in everything else
COPY . .