forked from lu-ci/apex-sigma-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
51 lines (39 loc) · 1.17 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
# |-------<[ Build ]>-------|
FROM python:3.6-slim AS build
RUN mkdir -p /build
WORKDIR /build
COPY requirements.txt ./
RUN apt-get update \
&& apt-get install -y \
build-essential \
libxml2-dev \
libxslt-dev \
libffi-dev \
&& pip install --no-cache-dir virtualenv \
&& virtualenv .venv \
&& . .venv/bin/activate \
&& pip install --no-cache-dir -r requirements.txt \
&& virtualenv --relocatable .venv \
&& sed -i -E 's|^(VIRTUAL_ENV="/)build(/.venv")$|\1app\2|' .venv/bin/activate \
&& rm -rf /var/lib/apt/lists/*
# |-------<[ App ]>-------|
FROM python:3.6-slim AS apex-sigma
LABEL maintainer="dev.patrick.auernig@gmail.com"
RUN echo "deb http://ftp.uk.debian.org/debian jessie-backports main" >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y \
libxml2 \
ffmpeg \
bash \
&& rm -rf /var/lib/apt/lists/*
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
WORKDIR /app
USER app
COPY --chown=app:app --from=build /build/.venv ./.venv
COPY --chown=app:app ./ ./
ENTRYPOINT ["/bin/bash"]
CMD ["./run.sh"]