Upload files to "/"

This commit is contained in:
Pierre_Herzog 2026-02-27 15:35:43 +01:00
parent 4ce9da671b
commit f43a048d30
2 changed files with 113 additions and 0 deletions

75
2026-02-26.md Normal file
View File

@ -0,0 +1,75 @@
[Jeudi 26 Février 2026]
# dockerisation de l'appli avec tout les paramètres
1. [Commande du jour]
docker build -t grabber:latest .
Explanation
A Dockerfile is a text-based document that's used to create a container image. It provides instructions to the image builder on the commands to run, files to copy, startup command, and more.
As an example, the following Dockerfile would produce a ready-to-run Python application:
FROM python:3.13.5
WORKDIR /usr/local/app
# Install the application dependencies
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy in the source code
COPY src ./src
EXPOSE 8080
# Setup an app user so the container doesn't run as the root user
RUN useradd app
USER app
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080"]
2. [DOCKER DOCKER DOCKER]
docker build -t grabber-app .
docker build -t grabber:latest .
docker run -dit --name grabber grabber:latest
docker ps
docker exec -ti eb25daZ bash
---------------------------
docker build -t grabber:latest . <- point pas oublier
docker rm --force grabber <supprimer le container du meme nom si test auparavant>
docker ps
docker container ls -a
docker container prune
docker logs grabber
docker run -dit --name grabber grabber
docker inspect grabber
docker exec -ti grabber bash mettreAdresseIP
compose.yml
services:
grabber:
build: .
depends_on : db
ports: -"8080:80"
db:
image: postgres:18
environment:
POSTGRES_USER: gb
POSTGRES_DB: gbdb
3. [Modif dans app.py]
pg_url = (
f"postgresql+psycopg://"
f"{os.getenv('POSTGRES_USER')}:"
f"{os.getenv('POSTGRES_PASSWORD')}"
f"@db:5432/"
f"{os.getenv('POSTGRES_DB')}"
)
print(f"URL PGDB: {pg_url}")
engine = create_engine(pg_url)
pour remplacer sqlite par postgres (postsql)

View File

@ -0,0 +1,38 @@
[Vendredi 27 Février 2026]
# docker compose avec un wordpress en local et remplacer SQlite par PGSQL
1. [Commande du jour]
2. [worpress local lmao]
|caddy.conf/nginx.conf
|-grabber.sh
|-gbapp|
|-app.py (tout les pys)
|-templates
|-static
|-gbcompose.yml
|-dockerfile
|-wp|
|-wpcompose.yml
docker compose -f wpcompose.yml up -d
1/ Dockerfile GB
2/ Compose PGSQL+GB
3/ Compose WP (wordpress)
4/ Reverse proxy
<CONSIGNE GRABBER 2 SEMAINES MAX POUR LES COMMITS A PARTIR DU 27>
-> projet on peut aller au garage semaine et WE (prévenir sur element)
-> DEUST formation en alternance, payant 800e l'année sans alternance (incertain pour 2026-2027) (2 semaines/2 semaines)
(consigne sur element)