Skip to content

Commit

Permalink
add docker without let's encrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
ClemsP committed Jan 15, 2022
1 parent 8a19d3e commit 93a8199
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 85 deletions.
11 changes: 0 additions & 11 deletions deployment/build.sh

This file was deleted.

4 changes: 0 additions & 4 deletions deployment/checklist.txt

This file was deleted.

2 changes: 1 addition & 1 deletion deployment/django/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ RUN useradd openrepairplatform

EXPOSE 8000

CMD /start.sh
CMD /start.sh
1 change: 0 additions & 1 deletion deployment/django/start.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env bash

rm /start.sh
sed -i "s/{{SECRET_KEY}}/${SECRET_KEY}/" /etc/cron.d/openrepairplatform
sed -i "s/{{EMAIL_PASSWORD}}/${EMAIL_PASSWORD}/" /etc/cron.d/openrepairplatform
service cron start
Expand Down
49 changes: 49 additions & 0 deletions deployment/docker-compose-no-certificat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
version: '3'

services:
db:
image: postgres:11
container_name: postgres
env_file:
- ../openrepairplatform/.env
volumes:
- ./openrepairplatform_data/postgres_data:/var/lib/postgresql/data
networks:
- openrepairplatform-net

django:
build:
context: ../
dockerfile: deployment/django/Dockerfile
image: openrepairplatform_python
container_name: openrepairplatform_python
ports:
- "8000:8000"
env_file:
- ../openrepairplatform/.env
volumes:
- ./openrepairplatform_data/openrepairplatform_static:/srv/static
- ./openrepairplatform_data/openrepairplatform_media:/srv/media
depends_on:
- db
networks:
- openrepairplatform-net

nginx:
image: nginx
container_name: openrepairplatform_nginx
ports:
- "80:80"
env_file:
- ../openrepairplatform/.env
volumes:
- ./openrepairplatform_data/openrepairplatform_static:/srv/static:ro
- ./openrepairplatform_data/openrepairplatform_media:/srv/media:ro
- ./nginx/nginx-no-certificat.conf:/etc/nginx/conf.d/default.conf
networks:
- openrepairplatform-net
depends_on:
- django

networks:
openrepairplatform-net:
2 changes: 1 addition & 1 deletion deployment/nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM debian:buster
RUN apt update -y && apt upgrade -y
RUN apt install -y nginx certbot

CMD sed -i "s/{{DOMAINE_NAME}}/${DOMAINE_NAME}/" /deployment/nginx/nginx.conf
CMD sed -i "s/{{DOMAINE_NAME}}/${DOMAINE_NAME}/g" /deployment/nginx/nginx.conf
COPY deployment/nginx/nginx.conf /etc/nginx/sites-enabled/default
COPY deployment/nginx/nginx-snippet.conf /etc/nginx/snippets/ssl-params.conf

Expand Down
2 changes: 1 addition & 1 deletion deployment/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ server {
listen 80;
listen [::]:80 default_server;
server_tokens off; #hide nginx version (security best practice)
server_name reparons.org;
server_name ${DOMAINE_NAME};
add_header Strict-Transport-Security "max-age=31536000";


Expand Down
36 changes: 0 additions & 36 deletions deployment/run.sh

This file was deleted.

12 changes: 12 additions & 0 deletions openrepairplatform/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
POSTGRES_USER=CHANGE_ME
POSTGRES_PASSWORD=CHANGE_ME
POSTGRES_DB_NAME=CHANGE_ME

DJANGO_SETTINGS_MODULE=openrepairplatform.settings.prod
SECRET_KEY=CHANGE_ME

EMAIL_PASSWORD=CHANGE_ME
EMAIL_HOST_USER=CHANGE_ME
EMAIL_HOST=CHANGE_ME

DOMAIN_NAME=CHANGE_ME
28 changes: 0 additions & 28 deletions openrepairplatform/settings/dev_docker.py

This file was deleted.

2 changes: 0 additions & 2 deletions openrepairplatform/settings/prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
DEBUG = True

ALLOWED_HOSTS = [
"127.0.0.1",
"reparons.org",
os.getenv("DOMAIN_NAME"),
]

Expand Down

0 comments on commit 93a8199

Please sign in to comment.