Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] docker image #229

Open
LoganTann opened this issue Mar 6, 2024 · 1 comment
Open

[Feature request] docker image #229

LoganTann opened this issue Mar 6, 2024 · 1 comment

Comments

@LoganTann
Copy link

Is this a bug report or a feature request?

This is a feature request

Version Info

  • Version of Majestic: 1.8.1
  • Version of Jest: 29.6.3
  • Version of Node: 18
  • Operating System: Windows 1°

Feature

It would be very cool to create a docker image to quickly start the app in a test container.

Example :

version: '3.8'

services:
   test-gui:
        image: majestic:1.8-alpine
        environment:
            # Usage : define arguments via environment variables
            - MAJESTIC_DEBUG=true
            - MAJESTIC_CONFIG=...
            # Pros : ability to pass env variables to jest
            - TEST_DATABASE_URL=postgres://test_user:test_password@test_db:5432/test_db
        depends_on:
            # Pros : ability to depend on other services (such as a DB)
            - test_db
        volumes:
            # Usage : Define a volume to specify the path of the project to test, eg.
            - .:/usr/src/app
            # Pros : Ability to persist jest cache in a volume
            - jestCache:/cache/jest
        ports:
            - '4000:4000'

volumes:
    jestCache:
        driver: local
@LoganTann
Copy link
Author

Workaround : use NPX


    ## Launchs a gui in port 4000 to run tests.
    test-gui:
        build:
            context: .
            target: development
            dockerfile: ./Dockerfile
        command: npx majestic --config docker --noOpen --debug
        environment:
            - TEST_DATABASE_URL=postgres://test_user:test_password@test_db:5432/test_db
            - REDIS_URL=redis://:@redis:6379
        depends_on:
            - test_db
        volumes:
            - .:/usr/src/app
            - jestCache:/cache/jest
        ports:
            - '4000:4000'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant