-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile
54 lines (44 loc) · 1.58 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
48
49
50
51
52
53
54
# Use the official lightweight Python image.
# https://hub.docker.com/_/python
FROM python:3.11.8-slim-bullseye
# 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 and pycdas...
WORKDIR /tmp
RUN git clone "https://github.com/zrax/pycdc.git" && \
cd pycdc && \
cmake . && \
cmake --build . --config release && \
mv ./pycdc /usr/local/bin && \
mv ./pycdas /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 . .