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

service "mystrapiAdminer" has neither an image nor a build context specified: invalid compose project #63

Closed
onesoftwareengineer opened this issue Mar 11, 2023 · 2 comments Β· Fixed by #64
Assignees
Labels

Comments

@onesoftwareengineer
Copy link

πŸ€·β€β™€οΈ What did you do

I added the following command to package.json then run it:
npx @strapi-community/dockerize new --dbclient=postgres --dbhost=localhost --dbport=5432 --dbname=bravobee --dbusername=postgres --dbpassword=DIHFLDmpmp@316ot --projecttype=js --packagemanager=yarn --usecompose=true --env=both

Then I tried to run:
docker compose up

⛔️ Error log

service "mystrapiAdminer" has neither an image nor a build context specified: invalid compose project

πŸ•΅οΈβ€β™€οΈ Stack trace

version: '3'
services:
  mystrapi:
    container_name: mystrapi
    build: .
    image: mystrapi:latest
    restart: unless-stopped
    env_file: .env
    environment:
      DATABASE_CLIENT: ${DATABASE_CLIENT}
      DATABASE_HOST: mystrapiDB
      DATABASE_NAME: ${DATABASE_NAME}
      DATABASE_USERNAME: ${DATABASE_USERNAME}
      DATABASE_PORT: ${DATABASE_PORT}
      JWT_SECRET: ${JWT_SECRET}
      ADMIN_JWT_SECRET: ${ADMIN_JWT_SECRET}
      DATABASE_PASSWORD: ${DATABASE_PASSWORD}
      NODE_ENV: ${NODE_ENV}
    volumes:
      - ./config:/opt/app/config
      - ./src:/opt/app/src
      - ./package.json:/opt/package.json
      - ./yarn.lock:/opt/yarn.lock

      - ./.env:/opt/app/.env
      - ./public/uploads:/opt/app/public/uploads
    ports:
      - '1337:1337'
    networks:
      - mystrapi
    depends_on:
      - mystrapiDB
      
  mystrapiDB:
    container_name: mystrapiDB
    platform: linux/amd64 #for platform error on Apple M1 chips
    restart: unless-stopped
    env_file: .env
    image: postgres:14.5-alpine
    environment:
      POSTGRES_USER: ${DATABASE_USERNAME}
      POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
      POSTGRES_DB: ${DATABASE_NAME}
    volumes:
      - mystrapi-data:/var/lib/postgresql/data/ #using a volume
      #- ./data:/var/lib/postgresql/data/ # if you want to use a bind folder

    ports:
      - '5432:5432'
    networks:
      - mystrapi
      
  mystrapiAdminer:
    container_name: mystrapiAdminer
    restart: unless-stopped
    ports:
      - '9090:8080'
    environment:
      - ADMINER_DEFAULT_SERVER=mystrapiDB
    networks:
      - mystrapi
    depends_on:
      - mystrapiDB

volumes:
  mystrapi-data:

networks:
  mystrapi:
    name: Mystrapi
    driver: bridge

πŸ™‡β€β™€οΈ Expected behavior/code

I was expecting the images to be pulled and then the containers do be started

@Eventyret
Copy link
Member

Will add a fix for it seems it's missing an image for adminer πŸ™‚
Should have image: dockette/adminer:latest

Eventyret pushed a commit that referenced this issue Mar 13, 2023
We where missing the actual image for adminer, also fixed minor tweaks with names

fix #63
@Eventyret
Copy link
Member

πŸŽ‰ This issue has been resolved in version 1.12.1 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€

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

Successfully merging a pull request may close this issue.

2 participants