forked from panther-labs/panther-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
59 lines (49 loc) · 1.42 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
55
56
57
58
59
FROM --platform=$TARGETPLATFORM cgr.dev/chainguard/wolfi-base
ARG TARGETPLATFORM
ARG PYTHON_VERSION="3.9.18"
RUN apk update \
&& apk add --no-cache \
bash \
build-base \
bzip2-dev \
git \
libffi-dev \
nodejs \
npm \
openssl-dev \
readline-dev \
sqlite-dev \
tk-dev \
wget \
xz-dev \
zlib \
zlib-dev
# Install pyenv
RUN git clone https://github.com/pyenv/pyenv.git ~/.pyenv \
&& cd ~/.pyenv && src/configure && make -C src \
&& for path in "$HOME/.bash_profile" "$HOME/.bashrc" "$HOME/.profile"; do \
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> "$path"; \
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> "$path"; \
echo 'eval "$(pyenv init -)"' >> "$path"; \
done
ENV PATH="/root/.pyenv/bin:$PATH"
ENV PATH="/root/.pyenv/shims:$PATH"
# Install Python
RUN pyenv install $PYTHON_VERSION \
&& pyenv global $PYTHON_VERSION
# Install pipenv
RUN pip install --upgrade pip
RUN pip install pipenv
WORKDIR /home/panther-analysis
# Install requirements
COPY Pipfile .
COPY Pipfile.lock .
RUN pipenv uninstall --all
RUN pipenv sync --dev
COPY package.json .
COPY package-lock.json .
RUN npm install
ENV PATH="/home/panther-analysis/node_modules/.bin:$PATH"
# Remove pipfile so it doesn't interfere with local files after install
RUN rm Pipfile
RUN rm Pipfile.lock