🗃️ - DB full init first time it starts w/ docker

This commit is contained in:
Florian Sylvain
2022-11-10 12:48:54 +01:00
parent 3c53d63b1f
commit 96fb0d3eab
3 changed files with 20 additions and 14 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ import { showsRouter } from './routes/shows.js'
dotenv.config()
const app = express()
const port = process.env.CINEALLO_PORT
const port = 3000
app.use(logger('dev'))
app.use(express.json())
+17 -11
View File
@@ -1,13 +1,4 @@
services:
backend:
build: .
image: cineallo-backend
env_file:
- .env
networks:
- back-net
ports:
- 3000:3000
db:
image: mysql:8.0.31
env_file:
@@ -19,8 +10,23 @@ services:
- "MYSQL_DATABASE=${MYSQL_DATABASE}"
volumes:
- ./mysql-data:/var/lib/mysql
# ports:
# - 3306:3306
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:3306" ]
interval: 5s
timeout: 15s
retries: 5
backend:
build: .
image: cineallo-backend
depends_on:
db:
condition: service_healthy
env_file:
- .env
networks:
- back-net
ports:
- "${CINEALLO_PORT}:3000"
networks:
back-net:
+1 -1
View File
@@ -4,7 +4,7 @@
"private": true,
"type": "module",
"scripts": {
"start": "node app.js"
"start": "prisma migrate deploy && node app.js"
},
"dependencies": {
"@prisma/client": "^4.6.0",