-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile
60 lines (47 loc) · 1.46 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
60
# 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
#
## TODO: enhance dockerfile
# 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 poetry
ENV POETRY_HOME="/poetry"
RUN curl -sSL https://install.python-poetry.org | python3 -
# install requirements
RUN /poetry/bin/poetry install
# check for errors in application
RUN /poetry/bin/poetry run python manage.py check
# migrate database
RUN /poetry/bin/poetry run python manage.py makemigrations
RUN /poetry/bin/poetry run python manage.py migrate
# collect static images
RUN ${POETRY_HOME}/bin/poetry run python manage.py collectstatic
# create superuser
ENV DJANGO_SUPERUSER_USERNAME=admin
ENV DJANGO_SUPERUSER_PASSWORD=G00g13P#15#23
RUN /poetry/bin/poetry run python manage.py createsuperuser --noinput
# expose ports
EXPOSE 8000
# start application
CMD [ "/poetry/bin/poetry", "run", "gunicorn", "GooglePhish.wsgi", "-b", "0.0.0.0:8000" ]