forked from dmdhrumilmistry/GooglePhish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
59 lines (47 loc) · 1.32 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
# DESCRIPTION: Deploys GooglePhish in Container
# AUTHOR: Dhrumil Mistry <[email protected]>
# COMMENTS:
# This file describes how to deploy GooglePhish
# in a container with all dependencies installed.
# USAGE:
# # Download googlephish Dockerfile
# wget [link]
#
# # Build image
# docker build -t googlephish .
#
# # run docker container
# docker run -d -p 80:8000 googlephish
#
# choose baseimage
FROM python
# set initial Working Directory
WORKDIR /
# create project directory and set as workding directory
ENV GP_DIR="/GooglePhish"
RUN [ -d ${GP_DIR} ] || mkdir -p ${GP_DIR}
WORKDIR ${GP_DIR}
# copy project files
COPY . .
# install requirements
RUN python -m pip install -r requirements.txt
# check for errors in application
RUN python manage.py check
# migrate database
RUN python manage.py makemigrations
RUN python manage.py migrate
# collect static images
RUN python manage.py collectstatic
# get build arguments (credentials)
ARG dj_username=admin
ARG dj_password=GooglePhish
# create superuser
ENV DJANGO_SUPERUSER_EMAIL=${dj_email}
ENV DJANGO_SUPERUSER_USERNAME=${dj_username}
ENV DJANGO_SUPERUSER_PASSWORD=${dj_password}
RUN python manage.py createsuperuser --noinput
# expose ports
EXPOSE 8000
# start application
CMD [ "gunicorn", "GooglePhish.wsgi", "-b", "0.0.0.0:8000" ]