-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (35 loc) · 1.16 KB
/
Dockerfile
File metadata and controls
54 lines (35 loc) · 1.16 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
#syntax=docker/dockerfile:1
FROM node:20.19.6-trixie-slim as base
ARG PY_VERSION="3.11.0"
ENV TZ="Asia/Jerusalem"
RUN apt-get update && \
apt-get install python3-pip -y && \
apt-get install dieharder -y && \
apt-get install wget -y && \
apt-get clean && \
apt-get autoremove
ENV HOME="/root"
WORKDIR ${HOME}
RUN apt-get install -y git libbz2-dev libncurses-dev libreadline-dev libffi-dev libssl-dev build-essential python3-dev
RUN git clone --depth=1 https://github.com/pyenv/pyenv.git .pyenv
ENV PYENV_ROOT="${HOME}/.pyenv"
ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"
RUN pyenv install $PY_VERSION
RUN pyenv global $PY_VERSION
WORKDIR /usr/src/app
COPY . .
RUN pip install -r requirements.txt
VOLUME ["/usr/src/app/dumps"]
VOLUME ["/usr/src/app/outputs"]
FROM base as prod
CMD python main.py
FROM base as dev
RUN pip install -r requirements-dev.txt
FROM base as test
RUN python -m pip install ".[test]"
CMD python -m pytest -vv -n 2
FROM test as lint
RUN pip install "pylint==3.3"
WORKDIR /usr/src/app
# .git is excluded from the image; mirror tracked *.py via find over the copied tree.
CMD ["sh", "-c", "pylint $(find . -name '*.py')"]