diff --git a/docker-compose.e2e.yml b/docker-compose.e2e.yml index fded55d3..ef90ee4e 100644 --- a/docker-compose.e2e.yml +++ b/docker-compose.e2e.yml @@ -7,9 +7,13 @@ services: POSTGRES_USER: ytfe2e POSTGRES_PASSWORD: ytfe2e POSTGRES_DB: ytfe2e + healthcheck: + test: ["CMD-SHELL", "pg_isready -d ytfe2e"] + start_period: 2s + interval: 1s server: - image: ghcr.io/yes-theory-fam/yestheory-family-server:COMMIT_HASH + image: ghcr.io/yes-theory-fam/yestheory-family-server:pr-266 hostname: server ports: - "5000:5000" @@ -28,11 +32,13 @@ services: CMS_ENDPOINT: "http://cms:3001/api/graphql" depends_on: - - cms - - postgres + cms: + condition: 'service_healthy' + postgres: + condition: 'service_healthy' web: - image: ghcr.io/yes-theory-fam/yestheory-family-web:COMMIT_HASH + image: ghcr.io/yes-theory-fam/yestheory-family-web:pr-266 environment: SERVER_BACKEND_GRAPHQL_URL: http://server:5000/graphql FRONTEND_URL: http://web:3000 @@ -42,7 +48,7 @@ services: - server cms: - image: ghcr.io/yes-theory-fam/yestheory-family-cms:COMMIT_HASH + image: ghcr.io/yes-theory-fam/yestheory-family-cms:pr-266 environment: DATABASE_URI: "postgresql://ytfe2e:ytfe2e@postgres:5432/payload?schema=public" ENABLE_DATASEEDER: "true" @@ -53,10 +59,17 @@ services: TYPESENSE_API_URL: http://typesense:8108 SERVER_URL: http://localhost:3001 FRONTEND_URL: http://web:3000 + healthcheck: + test: ["CMD-SHELL", "curl --fail http://localhost:3001/admin"] + start_period: 2s + interval: 1s ports: - "3001:3001" depends_on: - - typesense + postgres: + condition: 'service_healthy' + typesense: + condition: 'service_started' typesense: image: typesense/typesense:0.25.1 diff --git a/packages/cms/Dockerfile b/packages/cms/Dockerfile index ebf9dc86..e6920cd4 100644 --- a/packages/cms/Dockerfile +++ b/packages/cms/Dockerfile @@ -17,6 +17,8 @@ RUN yarn workspaces focus && \ FROM base as runtime +RUN apk add curl --no-cache + ENV NODE_ENV=production ENV PAYLOAD_CONFIG_PATH=packages/cms/dist/payload.config.js