Skip to content

🐛 Bug Report: Can not Build with Docker compose #590

Open
@Shahin-rmz

Description

@Shahin-rmz

📜 Description

Hello, I am trying to run the app on docker compose on a raspberry pi Linux OS.
The problem is, I get an error, which said,

WARNING: The AUTH_SECRET variable is not set. Defaulting to a blank string.
ERROR: The Compose file is invalid because:
Service app has neither an image nor a build context specified. At least one must be provided.

👟 Reproduction steps

here is the docker compose file that I have:

services:
  app:
    build:
      dockerfile: Dockerfile.prode
      target: production # Change this to production for prod builds (WIP)
    container_name: job-board-app
    environment:
      - DATABASE_URL=$DATABASE_URL
      - AUTH_SECRET=$AUTH_SECRET
    ports:
      - "3000:3000"
    volumes:
      - .:/usr/src/app
      - /usr/src/app/node_modules
    depends_on:
      db:
        condition: service_healthy

  db:
    image: postgres:16-alpine
    container_name: job-board-db
    restart: always
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: job-board-db
    ports:
      - 5432:5432
    volumes:
      - postgres-data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
      interval: 10s
      timeout: 5s
      retries: 5

  prisma-studio:
    container_name: prisma-studio
    image: timothyjmiller/prisma-studio:latest
    restart: unless-stopped
    env_file:
     - .env
    depends_on:
      - app
    ports:
      - 5555:5555

volumes:
  postgres-data:

here is the .env file that I have


#
# Database
#
DATABASE_URL="postgres://postgres:password@localhost:5432/postgres"

#
# AUTH
#
NEXTAUTH_SECRET= "xxx"
NEXTAUTH_URL="https://xxx"

#
# Bunny CDN
#
CDN_API_KEY=
CDN_BASE_UPLOAD_URL=
CDN_BASE_ACCESS_URL=

NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=

#
# Email SMTP credentials
#
[email protected]
EMAIL_PASSWORD=

#
# Google OAuth credentials
#
GOOGLE_CLIENT_ID=xxx
GOOGLE_CLIENT_SECRET=xxx



👍 Expected behavior

run the app and open the port

👎 Actual Behavior with Screenshots

getting the error

WARNING: The AUTH_SECRET variable is not set. Defaulting to a blank string.
ERROR: The Compose file is invalid because:
Service app has neither an image nor a build context specified. At least one must be provided.

OS name

Linux

browser name

Brave

npm version

No response

node version

No response

📃 Provide any additional context for the Bug.

No response

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find a similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to submit PR?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions