feat: fix db script exec order, onlyl use back-end.env files
This commit is contained in:
parent
bbf7a292ad
commit
690a242a78
@ -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
|
@ -3,5 +3,4 @@ FROM postgres:17
|
||||
WORKDIR /db
|
||||
|
||||
# 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/
|
||||
|
@ -6,11 +6,12 @@ WORKDIR /usr/src/back
|
||||
|
||||
# Copy sources
|
||||
COPY . .
|
||||
COPY .env.production .env
|
||||
|
||||
# install deps, and pm2 to run the app
|
||||
RUN npm install
|
||||
RUN npm install -g pm2
|
||||
# RUN npm install -g pm2
|
||||
|
||||
COPY .env.production .env
|
||||
|
||||
# Compilation des fichiers TypeScript
|
||||
RUN npm run build
|
||||
@ -23,4 +24,5 @@ RUN chmod -R u=rwx,g=,o= ./
|
||||
EXPOSE 3000
|
||||
|
||||
# Start app
|
||||
CMD ["pm2", "start", "dist/app.js", "--no-daemon"]
|
||||
CMD ["npm", "run", "startonly"]
|
||||
# CMD ["pm2", "start", "dist/app.js", "--no-daemon"]
|
||||
|
@ -2,6 +2,7 @@ services:
|
||||
database:
|
||||
hostname: database
|
||||
container_name: briques_postgres
|
||||
env_file: back-end/.env
|
||||
build:
|
||||
context: ./PostgreSQL
|
||||
dockerfile: Dockerfile
|
||||
|
@ -6,6 +6,7 @@ services:
|
||||
context: ./PostgreSQL
|
||||
dockerfile: Dockerfile
|
||||
restart: always
|
||||
env_file: back-end/.env.production
|
||||
environment:
|
||||
- POSTGRES_DB=${DB_NAME}
|
||||
- POSTGRES_USER=${DB_USER}
|
||||
|
Loading…
x
Reference in New Issue
Block a user