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

[Bug]: Coolify deletes node_modules contents in docker-compose deployments #4614

Closed
douglasg14b opened this issue Dec 18, 2024 · 1 comment
Closed

Comments

@douglasg14b
Copy link

douglasg14b commented Dec 18, 2024

Error Message and Logs

When a docker-compose build is done, the final container has its node_modules directory emptied.

This may be undesirable in cases where the built image is expected to operate on dependencies (Not a web server, but a collection of scripts, for example).

This behavior is not present when using Raw Docker Compose Deployment. However, this causes other features to be lost.

FROM node:20-alpine AS base

ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable pnpm
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0

FROM base AS builder

WORKDIR /app
COPY . .

# We go from installer instead of base because this project is really just meant to execute pnpm commands as a collection of scripts
# So we need pnpm and deps to be installed in the actual final image
FROM base AS runner
WORKDIR /app

COPY --from=builder /app/ .
RUN pnpm install --frozen-lockfile --prefer-offline

CMD ["sleep", "infinity"]

Steps to Reproduce

  1. Create a node project
  2. Create dockerfile & compose
  3. Build locally and notice container has node_modules
  4. Build in coolify and notice that node_modules is empty

Example Repository URL

No response

Coolify Version

v4.0.0-beta.379

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

Ubuntu 22.04

Additional Information

I don't see this behavior documented (Am I missing it?). Or how to work around it without going the Raw Docker Compose Deployment route, which is undesireable

@douglasg14b douglasg14b added 🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization. labels Dec 18, 2024
@douglasg14b douglasg14b changed the title [Bug]: Coolify deletes node_modules contents [Bug]: Coolify deletes node_modules contents Dec 18, 2024
@douglasg14b douglasg14b changed the title [Bug]: Coolify deletes node_modules contents [Bug]: Coolify deletes node_modules contents in docker-compose deployments Dec 18, 2024
@douglasg14b
Copy link
Author

After much ado, this was because the compose had a volume for node_modules

@github-actions github-actions bot removed 🐛 Bug Reported issues that need to be reproduced by the team. 🔍 Triage Issues that need assessment and prioritization. labels Dec 18, 2024
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

No branches or pull requests

1 participant