notiz-dev / nestjs-prisma-starter

Starter template for NestJS 😻 includes GraphQL with Prisma Client, Passport-JWT authentication, Swagger Api and Docker
MIT License
2.37k stars 336 forks source link

refactor: add WORKDIR to Runner image in Dockerfile #469

Closed sitogi closed 2 years ago

sitogi commented 2 years ago

Description

Added WORKDIR to the runner image to place build artifacts in the app directory instead of root dir.

Current behavior

Build artifacts were scattered in the root directory.

$ docker compose exec nest-api bash
root@e7a9f2f4ad78:/# ls
bin   dev   etc   lib    mnt           opt                package.json  root  sbin  srv  tmp  var
boot  dist  home  media  node_modules  package-lock.json  proc          run   src   sys  usr

New behavior

$ docker compose exec nest-api bash
root@ac5f46da764e:/app# ls
dist  node_modules  package-lock.json  package.json  src
root@ac5f46da764e:/app# ls /
app  bin  boot  dev  etc  home  lib  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var