Why my Dokcer frontend container is not created?
My project is quite big. Docker ps shows the following
COMMAND SERVICE CREATED STATUS PORTS
legal_marketplace_backend legalmercado-backend "uvicorn app.main:ap…" backend 4 minutes ago Up About a minute (health: starting) 0.0.0.0:8000-\>8000/tcp, \[::\]:8000-\>8000/tcp
legal_marketplace_db postgres:15-alpine "docker-entrypoint.s…" postgres 4 minutes ago Up 4 minutes (healthy) 0.0.0.0:5432-\>5432/tcp, \[::\]:5432-\>5432/tcp
legal_marketplace_pgadmin dpage/pgadmin4:latest "/entrypoint.sh" pgadmin 4 minutes ago Up 4 minutes 443/tcp, 0.0.0.0:5050-\>80/tcp, \[::\]:5050-\>80/tcp
legal_marketplace_redis redis:7-alpine "docker-entrypoint.s…" redis 4 minutes ago Up 4 minutes (healthy) 0.0.0.0:6379-\>6379/tcp, \[::\]:6379-\>6379/tcp
legal_marketplace_redpanda docker.redpanda.com/redpandadata/redpanda:v23.3.3 "/entrypoint.sh redp…" redpanda 4 minutes ago Up 4 minutes (healthy) 8081-8082/tcp, 0.0.0.0:18081-18082-\>18081-18082/tcp, \[::\]:18081-18082-\>18081-18082/tcp, 9092/tcp, 0.0.0.0:19092-\>19092/tcp, \[::\]:19092-\>19092/tcp, 0.0.0.0:19644-\>9644/tcp, \[::\]:19644-\>9644/tcp
legal_marketplace_redpanda_console docker.redpanda.com/redpandadata/console:v2.3.8 "./console" redpanda-console 4 minutes ago Up 4 minutes 0.0.0.0:8080-\>8080/tcp, \[::\]:8080-\>8080/tcp
Front is not created.I will post my frontend Dockerfile
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --silent
COPY . .
RUN npm run build
FROM node:18-alpine AS runner
WORKDIR /app
# install a tiny static server
RUN npm install -g serve@14 --silent
# copy build output from builder
COPY --from=builder /app/build /app/build
EXPOSE 80
# add wget for healthcheck
RUN apk add --no-cache wget
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --quiet --tries=1 --spider http://localhost/ || exit 1
CMD ["serve", "-s", "/app/build", "-l", "80"]
and docker-compose
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: legal_marketplace_db
environment:
POSTGRES_DB: legal_marketplace
POSTGRES_USER: legal_user
POSTGRES_PASSWORD: legal_password_change_in_production
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U legal_user -d legal_marketplace"]
interval: 10s
timeout: 5s
retries: 5
networks:
- legal_marketplace_network
# Redis Cache
redis:
image: redis:7-alpine
container_name: legal_marketplace_redis
command: redis-server --appendonly yes --requirepass redis_password_change_in_production
volumes:
- redis_data:/data
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 10s
timeout: 3s
retries: 5
networks:
- legal_marketplace_network
# Redpanda (Kafka alternative)
redpanda:
image: docker.redpanda.com/redpandadata/redpanda:v23.3.3
container_name: legal_marketplace_redpanda
command:
- redpanda
- start
- --kafka-addr internal://0.0.0.0:9092,external://0.0.0.0:19092
- --advertise-kafka-addr internal://redpanda:9092,external://localhost:19092
- --pandaproxy-addr internal://0.0.0.0:8082,external://0.0.0.0:18082
- --advertise-pandaproxy-addr internal://redpanda:8082,external://localhost:18082
- --schema-registry-addr internal://0.0.0.0:8081,external://0.0.0.0:18081
- --rpc-addr redpanda:33145
- --advertise-rpc-addr redpanda:33145
- --smp 1
- --memory 1G
- --mode dev-container
- --default-log-level=info
volumes:
- redpanda_data:/var/lib/redpanda/data
ports:
- "18081:18081" # Schema Registry
- "18082:18082" # Pandaproxy
- "19092:19092" # Kafka API
- "19644:9644" # Admin API
healthcheck:
test: ["CMD-SHELL", "rpk cluster health | grep -E 'Healthy:.+true' || exit 1"]
interval: 15s
timeout: 3s
retries: 5
networks:
- legal_marketplace_network
# Backend API
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: legal_marketplace_backend
environment:
# Application
APP_NAME: "Legal Marketplace"
ENVIRONMENT: development
DEBUG: "true"
HOST: 0.0.0.0
PORT: 8000
# Security
SECRET_KEY: "dev_secret_key_change_in_production_minimum_32_chars"
CSRF_SECRET: "dev_csrf_secret_change_in_production_minimum_32_chars"
ALGORITHM: HS256
ACCESS_TOKEN_EXPIRE_MINUTES: 30
REFRESH_TOKEN_EXPIRE_DAYS: 7
# Database
DATABASE_URL: "postgresql+asyncpg://legal_user:legal_password_change_in_production@postgres:5432/legal_marketplace"
DB_POOL_SIZE: 10
DB_MAX_OVERFLOW: 20
# Redis
REDIS_URL: "redis://:redis_password_change_in_production@redis:6379/0"
# Kafka
KAFKA_BOOTSTRAP_SERVERS: "redpanda:9092"
KAFKA_TOPIC_CASE_CREATED: "case.created"
KAFKA_TOPIC_MATCH_SCORED: "match.scored"
KAFKA_TOPIC_PROPOSAL_SUBMITTED: "proposal.submitted"
# Google OAuth (set your credentials)
GOOGLE_CLIENT_ID: "your-google-client-id"
GOOGLE_CLIENT_SECRET: "your-google-client-secret"
GOOGLE_REDIRECT_URI: "http://localhost:3000/auth/callback"
# CORS
CORS_ORIGINS: "http://localhost:3000,http://localhost:5173"
# Rate Limiting
RATE_LIMIT_ENABLED: "true"
RATE_LIMIT_PER_MINUTE: 60
volumes:
- ./backend:/app
- backend_uploads:/app/uploads
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
redpanda:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- legal_marketplace_network
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
# Frontend
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: legal_marketplace_frontend
environment:
NODE_ENV: development
REACT_APP_API_URL: "http://localhost:8000"
ports:
- "80:80"
depends_on:
- backend
networks:
- legal_marketplace_network
healthcheck:
test: ["CMD-SHELL", "wget --quiet --tries=1 --spider http://localhost/ || exit 1"]
interval: 30s
timeout: 3s
retries: 3
# Redpanda Console (Web UI for Kafka)
redpanda-console:
image: docker.redpanda.com/redpandadata/console:v2.3.8
container_name: legal_marketplace_redpanda_console
environment:
KAFKA_BROKERS: redpanda:9092
KAFKA_SCHEMAREGISTRY_ENABLED: "true"
KAFKA_SCHEMAREGISTRY_URLS: http://redpanda:8081
ports:
- "8080:8080"
depends_on:
- redpanda
networks:
- legal_marketplace_network
# pgAdmin (PostgreSQL Web UI)
pgadmin:
image: dpage/pgadmin4:latest
container_name: legal_marketplace_pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: admin@legalmarketplace.com
PGADMIN_DEFAULT_PASSWORD: admin_password_change_in_production
PGADMIN_CONFIG_SERVER_MODE: "False"
volumes:
- pgadmin_data:/var/lib/pgadmin
ports:
- "5050:80"
depends_on:
- postgres
networks:
- legal_marketplace_network
volumes:
postgres_data:
driver: local
redis_data:
driver: local
redpanda_data:
driver: local
backend_uploads:
driver: local
pgadmin_data:
driver: local
networks:
legal_marketplace_network:
driver: bridge
How can I test this setup? logs are abundant but I do not have frontend container.