merging from master

This commit is contained in:
damien DELPY 2024-11-23 21:39:19 +01:00
commit 7ba442cb17
No known key found for this signature in database
11 changed files with 14 additions and 11 deletions

View File

@ -1,6 +0,0 @@
NODE_PORT=3000
NODE_ENV=dev
DB_HOST=localhost
DB_NAME=briques_db
DB_USER=briques_llm
DB_PASSWORD=briques_password_2025

View File

@ -3,5 +3,4 @@ FROM postgres:17
WORKDIR /db WORKDIR /db
# postgresql will execute the files in that folder after build # postgresql will execute the files in that folder after build
COPY create.sql drop.sql insert.sql select.sql update.sql /docker-entrypoint-initdb.d/ COPY build/* /docker-entrypoint-initdb.d/

View File

@ -2,11 +2,17 @@
On aime les briques On aime les briques
## Sujet
* [Projet: Travail et modalités de rendu Fichier](https://moodle.bordeaux-inp.fr/mod/resource/view.php?id=48191)
* [Sujet : Briques Fichier](https://moodle.bordeaux-inp.fr/mod/resource/view.php?id=132493)
## Dev ## Dev
To run postgresql server + adminer in dev environnement (assuming you're running the backend manually with node), run : To run postgresql server + adminer in dev environnement (assuming you're running the backend manually with node), run :
``` ```
cp back-end/.env.example back-end/.env
docker compose -f docker-compose.dev.yml up docker compose -f docker-compose.dev.yml up
``` ```

View File

@ -6,11 +6,12 @@ WORKDIR /usr/src/back
# Copy sources # Copy sources
COPY . . COPY . .
COPY .env.production .env
# install deps, and pm2 to run the app # install deps, and pm2 to run the app
RUN npm install RUN npm install
RUN npm install -g pm2 # RUN npm install -g pm2
COPY .env.production .env
# Compilation des fichiers TypeScript # Compilation des fichiers TypeScript
RUN npm run build RUN npm run build
@ -23,4 +24,5 @@ RUN chmod -R u=rwx,g=,o= ./
EXPOSE 3000 EXPOSE 3000
# Start app # Start app
CMD ["pm2", "start", "dist/app.js", "--no-daemon"] CMD ["npm", "run", "startonly"]
# CMD ["pm2", "start", "dist/app.js", "--no-daemon"]

View File

@ -2,6 +2,7 @@ services:
database: database:
hostname: database hostname: database
container_name: briques_postgres container_name: briques_postgres
env_file: back-end/.env
build: build:
context: ./PostgreSQL context: ./PostgreSQL
dockerfile: Dockerfile dockerfile: Dockerfile

View File

@ -6,6 +6,7 @@ services:
context: ./PostgreSQL context: ./PostgreSQL
dockerfile: Dockerfile dockerfile: Dockerfile
restart: always restart: always
env_file: back-end/.env.production
environment: environment:
- POSTGRES_DB=${DB_NAME} - POSTGRES_DB=${DB_NAME}
- POSTGRES_USER=${DB_USER} - POSTGRES_USER=${DB_USER}