-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Dockerize backend #48
base: main
Are you sure you want to change the base?
Conversation
ec01d9d
to
41acb30
Compare
Dockerfile
Outdated
RUN npm ci --omit=dev --ignore-scripts | ||
RUN cp -RL node_modules/ /tmp/node_modules/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this to the second step of the build. Also, on both steps please install NPM version 10.1.0
Dockerfile.dev
Outdated
# Copy dependency information and install dependencies | ||
COPY *.json ./ | ||
|
||
RUN npm ci --ignore-scripts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please install NPM 10.1.0 before installing the packages
Dockerfile.dev
Outdated
RUN npm ci --ignore-scripts | ||
|
||
# Copy source code (and all other relevant files) | ||
COPY . . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a volume
Dockerfile.dev
Outdated
COPY . . | ||
|
||
# Generate Prisma Client | ||
RUN npx prisma generate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this to docker-dev-cmd
54b7158
to
122de1a
Compare
122de1a
to
07cd725
Compare
07cd725
to
7ccca5e
Compare
7ccca5e
to
b961d43
Compare
RUN npm install --ignore-scripts | ||
|
||
CMD [ "npm", "run", "docker-dev-cmd" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So changing a package means you will need to rebuild the image, right? and manually because docker won't notice that change, is this right?
Something like https://docs.docker.com/compose/file-watch/ would fix this and it may be "needed" (or a volume and check always update the packages), right? Otherwise changing a package will be a "painful" task making hard for someone to adopt this feature.
NOTION Ticket
Type of change
Description of the change
Modify the
docker-compose.yml
file to run the backend in a docker container, and also created aDockerfile.dev
file to use in the modified docker-compose.Also changed
docker-compose.yml
extension to.yaml
since this is preferred by docker.