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
|
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/
|
||||||
|
|
||||||
|
@ -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"]
|
||||||
|
@ -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
|
||||||
|
@ -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}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user