Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

gabrielmachin
Copy link
Collaborator

@gabrielmachin gabrielmachin commented Dec 20, 2023

NOTION Ticket

Type of change

  • Fix
  • Story
  • Chore

Description of the change

Modify the docker-compose.yml file to run the backend in a docker container, and also created a Dockerfile.dev file to use in the modified docker-compose.
Also changed docker-compose.yml extension to .yaml since this is preferred by docker.

Dockerfile Outdated
Comment on lines 8 to 9
RUN npm ci --omit=dev --ignore-scripts
RUN cp -RL node_modules/ /tmp/node_modules/
Copy link
Collaborator

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
Copy link
Collaborator

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 . .
Copy link
Collaborator

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
Copy link
Collaborator

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

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
@gabrielmachin gabrielmachin force-pushed the chore/Dockerize-backend branch 2 times, most recently from 54b7158 to 122de1a Compare December 21, 2023 19:00
@gabrielmachin gabrielmachin removed the wip label Jan 11, 2024
@gabrielmachin gabrielmachin force-pushed the chore/Dockerize-backend branch from 122de1a to 07cd725 Compare January 12, 2024 18:38
@gabrielmachin gabrielmachin force-pushed the chore/Dockerize-backend branch from 07cd725 to 7ccca5e Compare January 16, 2024 16:25
@gabrielmachin gabrielmachin force-pushed the chore/Dockerize-backend branch from 7ccca5e to b961d43 Compare January 16, 2024 16:28
@gabrielmachin gabrielmachin requested a review from jrg091 January 30, 2024 15:51
Comment on lines +9 to +11
RUN npm install --ignore-scripts

CMD [ "npm", "run", "docker-dev-cmd" ]
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants