-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7011880
commit 5af4ea4
Showing
5 changed files
with
55 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# .bashrc | ||
|
||
# Source global definitions | ||
if [ -f /etc/bashrc ]; then | ||
. /etc/bashrc | ||
fi | ||
|
||
# Uncomment the following line if you don't like systemctl's auto-paging feature: | ||
# export SYSTEMD_PAGER= | ||
|
||
# User specific aliases and functions | ||
source /home/django-app/.virtualenv/bin/activate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,37 @@ | ||
FROM fedora | ||
MAINTAINER http://fedoraproject.org/wiki/Cloud | ||
FROM fedora:27 | ||
MAINTAINER Marcelo Moreira de Mello <[email protected]> | ||
|
||
ENV PORT 8000 | ||
|
||
# create django-app user | ||
RUN useradd django-app | ||
|
||
# update and install dependencies | ||
RUN dnf clean all && \ | ||
dnf -y update && \ | ||
dnf -y install python3 python3-devel python3-pip git \ | ||
python3-virtualenv sqlite python-psycopg2 \ | ||
openssl-devel && dnf clean all | ||
python3-virtualenv sqlite openssl-devel && \ | ||
dnf clean all | ||
|
||
|
||
# create directory and mount sources there | ||
ADD start.sh requirements.txt mysslcerts /home/django-app/code/ | ||
RUN chmod +x /home/django-app/code/start.sh | ||
ADD .bashrc /home/django-app/ | ||
RUN chown django-app:django-app -R /home/django-app | ||
|
||
# set user | ||
USER django-app | ||
RUN /usr/bin/py3-virtualenv -p python3.6 /home/django-app/.virtualenv | ||
|
||
COPY mysslcerts /code | ||
RUN pip install -r /code/mysslcerts/requirements.txt | ||
# set workdir | ||
WORKDIR /home/django-app/code | ||
|
||
# create directory /code and mount sources there | ||
RUN mkdir /code | ||
WORKDIR /code | ||
VOLUME /code | ||
# export volume | ||
VOLUME /home/django-app/code | ||
|
||
EXPOSE 8000 | ||
# expose 8000 port | ||
EXPOSE ${PORT} | ||
|
||
CMD python mysslcerts/manage.py runserver 0.0.0.0:8000 | ||
# define command to start container | ||
ENTRYPOINT ["/bin/bash", "/home/django-app/code/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# my-ssl-certs | ||
Simple based Django application to request and sign custom SSL certificates | ||
|
||
|
||
### Credentials: | ||
admin: **mysslcerts** | ||
|
||
### Docker | ||
docker run -p 8000:8000 tchellomello/mysslcerts:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
PATH="/usr/bin:/usr/sbin" | ||
|
||
source /home/django-app/.virtualenv/bin/activate | ||
|
||
pip install -r /home/django-app/code/requirements.txt | ||
|
||
/home/django-app/code/manage.py runserver 0.0.0.0:${PORT} |