Skip to content

Commit

Permalink
[#183][migrate] all migrate fix for profile , friendship, and auth
Browse files Browse the repository at this point in the history
  • Loading branch information
Axel Vaganay committed Mar 25, 2024
1 parent 4203387 commit d1fb36b
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 130 deletions.
78 changes: 39 additions & 39 deletions authentification/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
# # Dockerfile du service profile
# Dockerfile du service profile

# FROM python:3.12-bookworm
FROM python:3.12-bookworm

# RUN mkdir /auth
# WORKDIR /auth
RUN mkdir /auth
WORKDIR /auth

# COPY requirements.txt /auth/
# RUN pip install --upgrade pip \
# && pip install --no-cache-dir -r requirements.txt
COPY requirements.txt /auth/
RUN pip install --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt

# COPY /auth/. .
COPY /auth/. .

# COPY script_python.sh /usr/local/bin/
# RUN chmod +x /usr/local/bin/script_python.sh
# ENTRYPOINT [ "script_python.sh" ]
COPY script_python.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/script_python.sh
ENTRYPOINT [ "script_python.sh" ]

# EXPOSE 8001
# # CMD ["tail", "-f", "/dev/null"]
EXPOSE 8001
# CMD ["tail", "-f", "/dev/null"]

# ##################################################

FROM python:3.12-bookworm
# FROM python:3.12-bookworm

# configuration de l'environnement Python qui evite lq creation de fichiers .pyc
ENV PYTHONDONTWRITEBYTECODE 1
# desactiver le buffering de la sortie standard
# assurant que la sortie est immediatement affichee sans delai
ENV PYTHONUNBUFFERED 1
# # configuration de l'environnement Python qui evite lq creation de fichiers .pyc
# ENV PYTHONDONTWRITEBYTECODE 1
# # desactiver le buffering de la sortie standard
# # assurant que la sortie est immediatement affichee sans delai
# ENV PYTHONUNBUFFERED 1

WORKDIR /app
# WORKDIR /app

# copie du fichier des dependances dans le conteneur
COPY requirements.txt /app/
# # copie du fichier des dependances dans le conteneur
# COPY requirements.txt /app/

# Mise a jour pip et install les dependances
RUN pip install --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt
# # Mise a jour pip et install les dependances
# RUN pip install --upgrade pip \
# && pip install --no-cache-dir -r requirements.txt

# copie du contenu de Django de l'appli dans le conteneur
COPY . /app/
# # copie du contenu de Django de l'appli dans le conteneur
# COPY . /app/

# COPY ./script_python.sh /app/
# RUN chmod 777 ./script_python.sh
# # COPY ./script_python.sh /app/
# # RUN chmod 777 ./script_python.sh

EXPOSE 8001
# EXPOSE 8001

# WORKDIR /app/auth
# # WORKDIR /app/auth

# # lancer l'appli Django
# CMD ["python", "manage.py", "runserver", "0.0.0.0:8001"]
# # # lancer l'appli Django
# # CMD ["python", "manage.py", "runserver", "0.0.0.0:8001"]

WORKDIR /app/auth
# WORKDIR /app/auth

RUN chmod +x ./script_python.sh
RUN chmod +x ./wait-for-it.sh
# RUN chmod +x ./script_python.sh
# RUN chmod +x ./wait-for-it.sh

# CMD ["python", "manage.py", "runserver", "0.0.0.0:8001"]
CMD ["./script_python.sh"]
# CMD ["ls", "-l", "script_python.sh"]
# # CMD ["python", "manage.py", "runserver", "0.0.0.0:8001"]
# CMD ["./script_python.sh"]
# # CMD ["ls", "-l", "script_python.sh"]
22 changes: 0 additions & 22 deletions authentification/auth/script_python.sh

This file was deleted.

12 changes: 12 additions & 0 deletions authentification/script_python.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -e

# Pour utiliser Postgres
python3 manage.py makemigrations

# Exécuter les migrations
python3 manage.py migrate

# Lancer l'application Django
python3 manage.py runserver 0.0.0.0:8001
74 changes: 37 additions & 37 deletions friendship/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
# # Dockerfile du service profile
# Dockerfile du service profile

# FROM python:3.12-bookworm
FROM python:3.12-bookworm

# RUN mkdir /friendshipApp
# WORKDIR /friendshipApp
RUN mkdir /friendshipApp
WORKDIR /friendshipApp

# COPY requirements.txt /friendshipApp/
# RUN pip install --upgrade pip \
# && pip install --no-cache-dir -r requirements.txt
COPY requirements.txt /friendshipApp/
RUN pip install --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt

# COPY /friendshipApp/. .
COPY /friendshipApp/. .

# COPY script_python.sh /usr/local/bin/
# RUN chmod +x /usr/local/bin/script_python.sh
# ENTRYPOINT [ "script_python.sh" ]
COPY script_python.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/script_python.sh
ENTRYPOINT [ "script_python.sh" ]

# EXPOSE 8003
# # CMD ["tail", "-f", "/dev/null"]
EXPOSE 8003
# CMD ["tail", "-f", "/dev/null"]

# ##################################################

# Dockerfile du service profile
# # Dockerfile du service profile

FROM python:3.12-bookworm
# FROM python:3.12-bookworm

# Autres configurations du Dockerfile
# # Autres configurations du Dockerfile

WORKDIR /app
# WORKDIR /app

COPY requirements.txt /app/
# COPY requirements.txt /app/

# # Pour fix le probleme backports.zoneinfo
# RUN pip install --upgrade pip setuptools wheel
# # # Pour fix le probleme backports.zoneinfo
# # RUN pip install --upgrade pip setuptools wheel

# Mise a jour pip et install les dependances
RUN pip install --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt
# # Mise a jour pip et install les dependances
# RUN pip install --upgrade pip \
# && pip install --no-cache-dir -r requirements.txt

# Copie des fichiers de l'application
COPY . /app/
# COPY ./authentification/auth/ /app/
# # Copie des fichiers de l'application
# COPY . /app/
# # COPY ./authentification/auth/ /app/

# WORKDIR /
# # WORKDIR /

# COPY ./authentification/auth/ /app/auth/
# # COPY ./authentification/auth/ /app/auth/

# Exposer le port sur lequel l'application Django écoute à l'intérieur du conteneur
EXPOSE 8003
# # Exposer le port sur lequel l'application Django écoute à l'intérieur du conteneur
# EXPOSE 8003

WORKDIR /app/friendshipApp
# WORKDIR /app/friendshipApp

RUN chmod +x ./script_python.sh
RUN chmod +x ./wait-for-it.sh
# RUN chmod +x ./script_python.sh
# RUN chmod +x ./wait-for-it.sh

# Commande pour lancer l'application Django
# CMD ["python3", "manage.py", "runserver", "0.0.0.0:8002"]
CMD [ "./script_python.sh" ]
# # Commande pour lancer l'application Django
# # CMD ["python3", "manage.py", "runserver", "0.0.0.0:8002"]
# CMD [ "./script_python.sh" ]

# CMD ["tail", "-f", "/dev/null"]
# # CMD ["tail", "-f", "/dev/null"]
21 changes: 0 additions & 21 deletions friendship/friendshipApp/script_python.sh

This file was deleted.

12 changes: 12 additions & 0 deletions friendship/script_python.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

set -e

# Pour utiliser Postgres
python3 manage.py makemigrations

# Exécuter les migrations
python3 manage.py migrate

# Lancer l'application Django
python3 manage.py runserver 0.0.0.0:8003
11 changes: 0 additions & 11 deletions migrate.sh

This file was deleted.

0 comments on commit d1fb36b

Please sign in to comment.