forked from e-m-b-a/embark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
60 lines (48 loc) · 1.54 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 kalilinux/kali-rolling:latest
ENV DEBIAN_FRONTEND=noninteractive
ENV DJANGO_SETTINGS_MODULE=embark.settings.deploy
ENV PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/bin
# TODO add all needed vars that are not in the .env
USER root
RUN apt-get update && apt-get -y -q --no-install-recommends install wget \
kmod \
procps \
sudo \
apt-utils \
default-libmysqlclient-dev \
default-mysql-client \
build-essential \
python3-dev \
libssl-dev \
swig \
pipenv \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /app
# * use emba from host or copy [root]
USER root
COPY ./emba/ /var/www/emba/
# * create user and add to sudoers [root]
USER root
RUN useradd www-embark -G sudo -c "embark-server-user" -M -r --shell=/usr/sbin/nologin -d /app/ && \
echo 'www-embark ALL=(ALL) NOPASSWD: /app/emba/emba' | EDITOR='tee -a' visudo
# * mkdir for apache
USER www-embark
RUN mkdir /app/media && mkdir /app/media/uploadedFirmwareImages && mkdir /app/media/emba_logs && \
mkdir /app/static && mkdir /app/conf
# * copy pipfile(s) and install pipenv [www-embark]
USER root
COPY --chown=www-embark:sudo ./Pipfile.lock /var/www/Pipfile.lock
USER www-embark
COPY ./Pipfile.lock /app/Pipfile.lock
RUN pipenv install
# * copy embark [www-embark]
USER www-embark
COPY ./embark /app/embark
# * copy .env[-]
COPY ./.env /app/.env
WORKDIR /app/
EXPOSE 80
# Opening on extra port for our ASGI setup
EXPOSE 8001
# source start-script TODO basically run-server.sh
ENTRYPOINT ["./entrypoint.sh"]