diff --git a/docker-compose.yml b/docker-compose.yml index 9eb830a..550f685 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,8 +26,8 @@ services: # Web Application (Next.js) webapp: build: - context: ./webapp - dockerfile: Dockerfile + context: . + dockerfile: webapp/Dockerfile target: runner container_name: infinity-webapp restart: unless-stopped @@ -44,55 +44,53 @@ services: networks: - infinity-network healthcheck: - test: ["CMD", "wget", "--spider", "http://localhost:3000/api/health"] + test: ["CMD", "wget", "--spider", "http://localhost:3000"] interval: 30s timeout: 10s retries: 3 start_period: 10s - # Worker Service - worker: - build: - context: ./worker - dockerfile: Dockerfile - container_name: infinity-worker - restart: unless-stopped - depends_on: - mongodb: - condition: service_healthy - environment: - - NODE_ENV=${NODE_ENV:-production} - - DB_URI=${DB_URI} - env_file: .env - networks: - - infinity-network + # Worker Service (temporarily disabled for initial deployment) + # worker: + # build: + # context: . + # dockerfile: worker/Dockerfile + # container_name: infinity-worker + # restart: unless-stopped + # depends_on: + # mongodb: + # condition: service_healthy + # environment: + # - NODE_ENV=${NODE_ENV:-production} + # - DB_URI=${DB_URI} + # env_file: .env + # networks: + # - infinity-network # Helper Service (runs once to create admin account) - create-admin: - build: - context: ./helpers - dockerfile: Dockerfile - container_name: infinity-create-admin - depends_on: - mongodb: - condition: service_healthy - environment: - - DB_URI=${DB_URI} - - ADMIN_USERNAME=${ADMIN_USERNAME} - - ADMIN_PASSWORD=${ADMIN_PASSWORD} - - NODE_ENV=${NODE_ENV:-production} - env_file: .env - networks: - - infinity-network - command: sh -c "python create_account.py" - profiles: ["create-admin"] + # create-admin: + # build: + # context: . + # dockerfile: helpers/Dockerfile + # container_name: infinity-create-admin + # depends_on: + # mongodb: + # condition: service_healthy + # environment: + # - DB_URI=${DB_URI} + # - ADMIN_USERNAME=${ADMIN_USERNAME} + # - ADMIN_PASSWORD=${ADMIN_PASSWORD} + # - NODE_ENV=${NODE_ENV:-production} + # env_file: .env + # networks: + # - infinity-network + # command: sh -c "python create_account.py" + # profiles: ["create-admin"] networks: infinity-network: driver: bridge - name: infinity-network volumes: mongodb_data: - driver: local - name: infinity-mongodb-data \ No newline at end of file + driver: local \ No newline at end of file diff --git a/webapp/Dockerfile b/webapp/Dockerfile index 3e0d5b2..88453e7 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -31,8 +31,7 @@ WORKDIR /app RUN apk add --no-cache dumb-init # Create non-root user -RUN addgroup --system --gid 1001 nodejs && \ - adduser --system --uid 1001 nextjs +RUN addgroup -S nodejs && adduser -S nextjs -G nodejs # Copy necessary files from builder COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./