Hello I don't know where I am wrong when trying to use the docker compose with postgress
docker compose yml:
version: "3.7"
services:
db:
image: postgres
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: emasa
volumes:
- ./pgdata:/var/lib/postgresql/data
ports:
- "5432:5432"
web:
image: emasapg
depends_on:
- dbs
ports:
- "4000:4000"
dockerfile
FROM node as builder
WORKDIR usr/app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
FROM node
WORKDIR usr/app
COPY package*.json ./
RUN npm install --production
COPY --from=builder /usr/app/dist ./dist
COPY ormconfig.docker.json ./ormconfig.json
COPY .env .
expose 4000
CMD node dist/src/index.js
my package.json:
{
"name": "back-end",
"version": "0.0.1",
"description": "Awesome project developed with TypeORM.",
"devDependencies": {
"@types/express": "^4.17.3",
"@types/graphql": "^14.5.0",
"@types/node": "^13.9.1",
"ts-node": "8.6.2",
"typescript": "3.3.3333"
},
"dependencies": {
"apollo-server-express": "^2.11.0",
"express": "^4.17.1",
"graphql": "^14.6.0",
"pg": "^7.3.0",
"reflect-metadata": "^0.1.13",
"typeorm": "0.2.24"
},
"scripts": {
"start": "ts-node src/index.ts"
}
}
err:
npm ERR! missing script: build
my file structure:
the error starts on this line:
line 6 : RUN npm run build
Edit: had forgotten to add the package.json to the question
packages.json
file ? - WaLid LamRaoui