Can't instal Nocobase using Docker

Hi, I’m an absolute beginner. Just working out how to use terminal in Mac. Finally succeeded in getting Docker to work after several hours. Now stuck with Nocobase.

Here is what I have:
Latest version Sequoia 15.3.1
Latest version Docker 4.39.0

Here is what I have done.

  1. Downloaded Rosetta 2
  2. Tried to follow the Nocobase instal instructions for Docker
    I have tried steps 1 and 2 a few times.

Here is the latest message on Terminal:
Last login: Sat Mar 8 10:03:27 on ttys000
The default interactive shell is now zsh.
To update your account to use zsh, please run chsh -s /bin/zsh.
For more details, please visit Use zsh as the default shell on your Mac - Apple Support.
DW-Airbk-2023:~ davidwilliams$ nocobase/nocobase:latest
-bash: nocobase/nocobase:latest: No such file or directory
DW-Airbk-2023:~ davidwilliams$

  1. Tried Step 4 - [localhost:13000] - won’t open. “This site can’t be reached”

Any suggestions would be greatly appreciated. I’m about to give up!

Hi,

After the docker instalaed, you can create file called docker-compose and add the code below and run the commmand: docker compose -f docker-compose.yml up -d

version: '3'

networks:
  nocobase:
    driver: bridge

services:
  app:
    image: nocobase/nocobase:latest

    networks:
      - nocobase
    depends_on:
      - postgres
    environment:
      # The application's secret key, used to generate user tokens, etc.
      # If APP_KEY is changed, old tokens will also become invalid.
      # It can be any random string, and make sure it is not exposed.
      - APP_KEY=your-secret-key
      # Database type, supports postgres, mysql, mariadb
      - DB_DIALECT=postgres
      # Database host, can be replaced with the IP of an existing database server
      - DB_HOST=postgres
      # Database name
      - DB_DATABASE=nocobase
      # Database user
      - DB_USER=nocobase
      # Database password
      - DB_PASSWORD=nocobase
      # Timezone
      - TZ=Asia/Shanghai
    volumes:
      - ./storage:/app/nocobase/storage
    ports:
      - '13000:80'
    # init: true

  # If using an existing database server, postgres service can be omitted
  postgres:
    image: postgres:16
    restart: always
    command: postgres -c wal_level=logical
    environment:
      POSTGRES_USER: nocobase
      POSTGRES_DB: nocobase
      POSTGRES_PASSWORD: nocobase
    volumes:
      - ./storage/db/postgres:/var/lib/postgresql/data
    ports:
      - '5433:5432'
    networks:
      - nocobase

After executed the comand, you can acess nocobase app using browser http://localhost:13000

For more details: https://docs.nocobase.com/welcome/getting-started/installation/docker-compose

Hi, many thanks for your detailed reply. I tried to follow your instructions, but still cannot access localhost:13000.

I first tried re-creating the docker-compose file as follows:

~ davidwilliams$ touch docker-compose.yml

I checked if this file was there as follows:
~ davidwilliams$ ls docker-compose
ls: docker-compose: No such file or directory

So I tried checking again with the .yml attached:

~ davidwilliams$ ls docker-compose.yml
docker-compose.yml

I guess that means it is somewhere on my Mac?

I then entered the code you had given by pasting it into Terminal. But every line was followed by a reply something like this:

~ davidwilliams$ version: ‘3’
-bash: version:: command not found

~ davidwilliams$ driver: bridge
-bash: driver:: command not found

Also, entering the line, docker compose -f docker-compose.yml up -d
came up with this response:
~ davidwilliams$ docker compose -f docker-compose.yml up -d
empty compose file

Am I meant to be doing all this through Terminal, or should it be entered somewhere within the Docker desktop app? As I say, I’m very much a beginner in all of this. Thanks