Ankit Halder
Ankit Halder

Reputation: 169

deploy latest container in dokploy

I am using dokploy to deploy docker containers, but when I try to deploy a latest version of a container its not working because its not fetching the latest image from the repository

My docker file

version: '3.9'

services:
  backend:
    image: registry.gitlab.com/my-repo/my-code:latest
    container_name: backend
    ports:
      - 4000
    environment:
      NODE_ENV: development 
    restart: always

What I have already tried

Hacks that are working but I don't want to use, I want to automate the process

Upvotes: 0

Views: 216

Answers (1)

Hans Kilian
Hans Kilian

Reputation: 25569

Set pull_policy to always like this

version: '3.9'

services:
  backend:
    image: registry.gitlab.com/my-repo/my-code:latest
    pull_policy: always
    container_name: backend
    ports:
      - 4000
    environment:
      NODE_ENV: development 
    restart: always

and compose will pull the image when you do docker compose up.

Documentation here.

Upvotes: 2

Related Questions