forked from lu-ci/apex-sigma-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (34 loc) · 1.38 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
FROM python:3.9-slim
LABEL maintainer="[email protected]"
ARG user_uid=1000
ARG user_gid=1000
RUN addgroup --system --gid "$user_gid" app \
&& adduser --system --ingroup app --uid "$user_uid" app
RUN mkdir -p /app && chown app:app /app
COPY --chown=app:app ./ /app
RUN apt-get update && apt-get install -y gnupg \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8B48AD6246925553 7638D0442B90D010 CBF8D6FD518E17E1 \
&& echo "deb [check-valid-until=no] http://cdn-fastly.deb.debian.org/debian jessie main" > /etc/apt/sources.list.d/jessie.list \
&& echo "deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list \
&& sed -i '/deb http:\/\/\(deb\|httpredir\).debian.org\/debian jessie.* main/d' /etc/apt/sources.list \
&& apt-get -o Acquire::Check-Valid-Until=false update \
&& apt-get install -y \
build-essential \
libxml2-dev \
libxslt-dev \
libffi-dev \
git \
ffmpeg \
bash \
&& python -m pip install -U pip \
&& pip install --no-cache-dir virtualenv \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
USER app
RUN virtualenv .venv \
&& . .venv/bin/activate \
&& python -m pip install -U pip \
&& pip install --no-cache-dir -r requirements.txt \
&& sed -i -E 's|^(VIRTUAL_ENV="/)build(/.venv")$|\1app\2|' .venv/bin/activate
ENTRYPOINT ["/bin/bash"]
CMD ["./run.sh"]