majestic icon indicating copy to clipboard operation
majestic copied to clipboard

[Feature request] docker image

Open LoganTann opened this issue 1 year ago • 1 comments

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 avatar Mar 06 '24 10:03 LoganTann

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'

LoganTann avatar Apr 02 '24 12:04 LoganTann