Resolved merge conflict by keeping README.md file.
This commit is contained in:
parent
a75372cff7
commit
c460f37026
1
.gitignore
vendored
1
.gitignore
vendored
@ -49,3 +49,4 @@ cabal.project.local
|
||||
cabal.project.local~
|
||||
.HTF/
|
||||
.ghc.environment.*
|
||||
id_rsa
|
||||
|
34
README.md
34
README.md
@ -1,2 +1,36 @@
|
||||
# leCoffre
|
||||
[Owner: Elise Hautefaye]
|
||||
|
||||
### A. Docker Launch application
|
||||
#### 1) Local RSA Key for docker build
|
||||
|
||||
1) Create a file named : `id_rsa` in /src
|
||||
2) Get the RSA Private key on Keeper who is allowed to read the `leCoffre-ressources repo`
|
||||
3) You can find Key on Keeper inside the folder **LeCoffre project > SSH Key**
|
||||
4) Copy past in the `id_rsa` that you created step 1
|
||||
|
||||
:rotating_light: **Be aware to have the id_rsa included in your .gitignore! This ssh shouldn't be push on github**
|
||||
|
||||
> You need to do the same task in the front and back repo.
|
||||
|
||||
#### 2) Build images
|
||||
|
||||
###### a- Back end
|
||||
`docker build -t "le-coffre-back" -f Dockerfiles/Dockerfile.api .`
|
||||
###### b- Front end
|
||||
`docker build -t "le-coffre-front" -f Dockerfiles/Dockerfile.front .`
|
||||
|
||||
#### 3) Docker Run
|
||||
|
||||
`docker run --env-file .env -p 3000:3000 le-coffre-back`
|
||||
|
||||
#### 4) Docker Compose
|
||||
|
||||
Docker compose allow to launch multiples images
|
||||
1) **le-coffre-front**
|
||||
2) **le-coffre-back**
|
||||
3) **postgres**
|
||||
|
||||
> Launch your docker container with following command :
|
||||
|
||||
`docker compose up -d`
|
@ -4,16 +4,38 @@ volumes:
|
||||
db_storage:
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: lecoffrelocal
|
||||
restart: always
|
||||
front-end:
|
||||
image: "le-coffre-front"
|
||||
ports:
|
||||
- 3000:${FRONT_PORT}
|
||||
environment:
|
||||
- POSTGRES_USER
|
||||
- POSTGRES_PASSWORD
|
||||
- POSTGRES_DB
|
||||
- DATABASE_USERNAME
|
||||
- FRONT_PORT
|
||||
backend:
|
||||
image: "le-coffre-back"
|
||||
ports:
|
||||
- 3001:${APP_PORT}
|
||||
environment:
|
||||
- DATABASE_HOSTNAME
|
||||
- DATABASE_PORT
|
||||
- DATABASE_USER
|
||||
- DATABASE_PASSWORD
|
||||
- DATABASE_NAME
|
||||
- APP_LABEL
|
||||
- APP_PORT
|
||||
- APP_ROOT_URL
|
||||
- API_ROOT_URL
|
||||
- DEV_PRISMA_STUDIO_DB_URL
|
||||
|
||||
postgres:
|
||||
image: postgres
|
||||
restart: always
|
||||
environment:
|
||||
- DATABASE_HOSTNAME
|
||||
- DATABASE_PORT
|
||||
- DATABASE_USER
|
||||
- DATABASE_PASSWORD
|
||||
- DATABASE_NAME
|
||||
- POSTGRES_PASSWORD
|
||||
ports:
|
||||
- ${DATABASE_PORT}:5432
|
||||
volumes:
|
||||
@ -21,7 +43,7 @@ services:
|
||||
- ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
|
||||
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||||
test: ["CMD-SHELL", "pg_isready -h localhost -U ${DATABASE_USER} -d ${DATABASE_NAME}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
@ -17,13 +17,13 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"api:start": "node ./dist/entries/App.js",
|
||||
"api:start": "npm run migrate && node ./dist/entries/App.js",
|
||||
"start": "tsc && npm run api:start",
|
||||
"dev": "nodemon -V",
|
||||
"api:dev": "nodemon -V --exec 'tsc && npm run api:start'",
|
||||
"build:test": "tsc && mocha ./dist/entries/Test.js",
|
||||
"format": "prettier --write src",
|
||||
"migrate": ""
|
||||
"migrate": "npx prisma migrate deploy"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
Loading…
x
Reference in New Issue
Block a user