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

When deploying applications through AutoDeploy, Docker cannot update #1177

Closed
faner11 opened this issue Jan 23, 2025 · 7 comments · Fixed by #1217
Closed

When deploying applications through AutoDeploy, Docker cannot update #1177

faner11 opened this issue Jan 23, 2025 · 7 comments · Fixed by #1217

Comments

@faner11
Copy link

faner11 commented Jan 23, 2025

To Reproduce

Create a new application through Dockerfile, trigger AutoDeploy through git push, everything works fine at the beginning, but after a few attempts, it will prompt that the deployment is successful, but the image is not updated.

Current vs. Expected behavior

Create a new application and trigger AutoDeploy through git push. Once built successfully, it can be replaced successfully in the first few attempts, but after a few attempts, it cannot be replaced.
But after clicking the Deploy button on the console to build successfully, it can be successfully replaced.

Provide environment information

Operating System:0s: 
Ubuntu 24.x
Arch: arm64
Dokploy version: 0.17.6 / 0.17.5
'VPS Provider: AWS
What applications/services are you tying to deploy?
Nodejs,SPA

Which area(s) are affected? (Select all that apply)

Docker

Are you deploying the applications where Dokploy is installed or on a remote server?

Same server where Dokploy is installed

Additional context

I have been using dokploy for a long time and it used to work fine. This problem only occurred after I updated to 0.17.5

Will you send a PR to fix it?

Maybe, need help

@faner11 faner11 added the bug Something isn't working label Jan 23, 2025
@Siumauricio
Copy link
Contributor

Most likely it's the dockerfile cache, this helps to make deployments take less time and gives the impression that it's a bug, if you could share your dockerfile to test it would be great, in v0.17.4 we added a flag to clear the cache so you wouldn't have this problem, can you try enabling this flag and retesting if you have the same problem?

Image

Image

@Siumauricio Siumauricio added awaiting-feedback and removed bug Something isn't working labels Jan 23, 2025
@faner11
Copy link
Author

faner11 commented Jan 23, 2025

This is my Dockerfile. My project uses Turborepo

FROM public.ecr.aws/docker/library/node:22.11-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

FROM base AS builder
# # Set working directory
WORKDIR /app
RUN pnpm add turbo -g
COPY . .
RUN turbo prune @app/web --docker

 
# Add lockfile and package.json's of isolated subworkspace
FROM base AS installer
WORKDIR /app
 
# # First install the dependencies (as they change less often)
COPY --from=builder /app/out/json/ .
RUN pnpm i
# Build the project
COPY --from=builder /app/out/full/ .
RUN pnpm run db:generate
RUN pnpm exec turbo run build --filter=@app/web
 

FROM public.ecr.aws/nginx/nginx:alpine

EXPOSE 8080

WORKDIR /public
COPY --from=installer /app/apps/web/nginx/default.conf /etc/nginx/conf.d/default.conf
COPY --from=installer /app/apps/web/dist /public/

@faner11
Copy link
Author

faner11 commented Jan 23, 2025

@Siumauricio I found Clean Cache on Applications, it is turned on and not turned off

@faner11 faner11 changed the title When deploying applications through AutoDokplay, Docker cannot update When deploying applications through AutoDeploy, Docker cannot update Jan 23, 2025
@faner11
Copy link
Author

faner11 commented Jan 23, 2025

@Siumauricio I found Clean Cache on Applications, it is turned on and not turned off

When I turn off this switch, everything returns to normal

@Siumauricio
Copy link
Contributor

Ok, I will turn off Clean Cache on Applications in this PR #1182

@avarayr
Copy link

avarayr commented Jan 23, 2025

Did we figure out why exactly this happens?

@Siumauricio Siumauricio linked a pull request Jan 26, 2025 that will close this issue
@Siumauricio
Copy link
Contributor

Siumauricio commented Jan 26, 2025

I couldn't reproduce it, but what I will do is the following:

  • Docker cleanups will be much less aggressive to prevent data loss
  • We will update the admin table in the cleanupCacheApplications field to set it to false, previously it was set to true which may have caused many people to have this problem and not notice it, for now it will be disabled by default.
    refactor: make less aggressive cleanups #1217

If you still experience the same, you can do a little hack to invalidate the cache in your Dockerfile

Add this line before you build the code
ADD https://www.google.com /time.now

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

Successfully merging a pull request may close this issue.

3 participants