Skip to content
Snippets Groups Projects
Commit cf0127ba authored by salazard's avatar salazard
Browse files

add docker compose front

parent eda5561c
No related branches found
No related tags found
1 merge request!60add docker compose for backend
......@@ -32,3 +32,5 @@ static/
# Supervisor
supervisord.pid
sendgrid.env
api_mail
.gitignore
FROM python:3.8
WORKDIR /var/www/oser-backend
COPY . .
VOLUME [ "/var/www/oser-backend" ]
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y build-essential postgresql libpq-dev python3-dev git
RUN python3 -m pip install -r requirements.txt
COPY ./requirements.txt .
VOLUME [ "/var/www/oser-backend" ]
EXPOSE 8000
RUN python3 -m pip install -r requirements.txt
CMD python3 manage.py makemigrations && python3 manage.py migrate && python3 manage.py runserver 0.0.0.0:8000
# Use postgres/example user/password credentials
version: '3.1'
services:
db:
container_name: postgres
image: postgres
restart: always
volumes:
......@@ -12,12 +12,27 @@ services:
POSTGRES_PASSWORD: q
POSTGRES_DB: oser_backend_db
oser:
image: oser-backend:latest
oser-backend:
container_name: oser-backend
build:
context: .
dockerfile: Dockerfile
restart: always
volumes:
- .:/var/www/oser-backend
ports:
- "8000:8000"
depends_on:
- db
oser-frontend:
container_name: oser-frontend
build:
context: ../oser-frontend
dockerfile: Dockerfile
restart: always
volumes:
- .:/var/www/oser-backend
ports:
- "4200:4200"
volumes:
db_data: {}
\ No newline at end of file
......@@ -5,7 +5,7 @@ from .common import *
from .common import BASE_DIR
DEBUG = True
ALLOWED_HOSTS = ['localhost','127.0.0.1']
ALLOWED_HOSTS = ['localhost','127.0.0.1','oser-backend']
# Static files (CSS, JavaScript, Images) and media files (user-uploaded)
......
......@@ -15,8 +15,6 @@ DEBUG = os.environ.get('DEBUG', False) or False
ALLOWED_HOSTS = [
'localhost',
'oser-backend.herokuapp.com',
'oser-backend-dev.herokuapp.com',
'oser-cs.fr',
]
......
# Generated by Django 2.2 on 2022-11-11 21:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0016_auto_20211225_1242'),
]
operations = [
migrations.AlterField(
model_name='tutor',
name='promotion',
field=models.IntegerField(choices=[(2025, '2025'), (2024, '2024'), (2023, '2023'), (2022, '2022'), (2021, '2021')], default=2025),
),
]
......@@ -3,9 +3,10 @@ from ..models import Participation
def postgres_migration_prep(apps, schema_editor):
participations = Participation.objects.filter(accepted=True)
for participation in participations:
participation.accepted = 1
# participations = Participation.objects.filter(accepted=True)
# for participation in participations:
# participation.accepted = 1
pass
class Migration(migrations.Migration):
......
# Generated by Django 2.2 on 2022-11-11 21:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('visits', '0004_auto_20211225_1242'),
]
operations = [
migrations.AlterField(
model_name='participation',
name='accepted',
field=models.IntegerField(choices=[(0, 'refusé'), (1, 'accepté'), (2, 'en attente'), (3, 'inconnue')], default=3, help_text='Cocher pour confirmer au tutoré sa participation à la sortie.'),
),
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment