overleaf/server-ce/test/docker-compose.yml
Jakob Ackermann 1b0c4215b8 Merge pull request #16995 from overleaf/jpa-fix-server-ce-e2e
[server-ce] fix e2e tests

GitOrigin-RevId: 95a9edd44a50254ac9f680368cf8e10bbf827d69
2024-02-09 09:08:13 +00:00

83 lines
2.2 KiB
YAML

version: '2.2'
services:
sharelatex:
image: ${IMAGE_TAG:-sharelatex/sharelatex:latest}
container_name: sharelatex
depends_on:
mongo:
condition: service_healthy
redis:
condition: service_started
ports:
- 127.0.0.2:80:80
links:
- mongo
- redis
environment:
OVERLEAF_APP_NAME: Overleaf Community Edition
OVERLEAF_MONGO_URL: mongodb://mongo/sharelatex?directConnection=true
OVERLEAF_REDIS_HOST: redis
REDIS_HOST: redis
ENABLED_LINKED_FILE_TYPES: 'project_file,project_output_file'
ENABLE_CONVERSIONS: 'true'
EMAIL_CONFIRMATION_DISABLED: 'true'
healthcheck:
test: curl --fail http://localhost:3000/status || exit 1
interval: 10s
timeout: 10s
retries: 10
volumes:
- ./util/seed-mongo.sh:/etc/my_init.d/99_seed-mongo.sh
- ./util/seed-mongo.js:/overleaf/services/web/modules/server-ce-scripts/scripts/seed-mongo.js
mongo:
image: mongo:5.0.17
container_name: mongo
command: '--replSet overleaf'
expose:
- 27017
healthcheck:
# FIXME: silly hack to make sure replicaset is initialized
test: 'echo ''rs.initiate({ _id: "overleaf", members: [{ _id: 0, host: "mongo:27017" }] })'' | mongo localhost:27017/test --quiet'
interval: 10s
timeout: 10s
retries: 5
redis:
image: redis:7.2.1
container_name: redis
expose:
- 6379
e2e:
image: cypress/included:13.3.3
links:
- sharelatex
working_dir: /e2e
volumes:
- ./:/e2e
environment:
CYPRESS_BASE_URL: http://sharelatex
SPEC_PATTERN: '**/*.spec.{js,jsx,ts,tsx}'
depends_on:
sharelatex:
condition: service_healthy
e2e-open:
image: cypress/included:13.3.3
entrypoint: npm
command: run cypress:open
links:
- sharelatex
working_dir: /e2e
volumes:
- ./:/e2e
- /tmp/.X11-unix:/tmp/.X11-unix
user: "${DOCKER_USER:-1000:1000}"
environment:
CYPRESS_BASE_URL: http://sharelatex
SPEC_PATTERN: '**/*.spec.{js,jsx,ts,tsx}'
DISPLAY: ${DISPLAY:-:0}
depends_on:
sharelatex:
condition: service_healthy