0

I'm using Laravel Envoy and GitLab CI/CD to deploy my application, when i try to run npm install using Sail i get the following error:

the input device is not a TTY

here's my envoy task:

@task('run_compile')
{{ logMessage("Running compile...") }}
cd {{$deploy_path}}
./vendor/bin/sail npm ci
{{ logMessage("Npm packages installed") }}
./vendor/bin/sail npm run prod --silent --no-progress
{{ logMessage("Npm packages built") }}
rm -rf node_modules
{{ logMessage("Compile completed") }}
@endtask
Pezhvak
  • 9,633
  • 7
  • 29
  • 39

2 Answers2

1

I think naming your Laravel container and running the following commands is a better approach.

docker exec laravel_sail_shop npm ci

For Example in docker-composer.yml you can name Laravel sail container like this

version: "3"
services:
  laravel.test:
    build:
      context: ./vendor/laravel/sail/runtimes/8.0
      dockerfile: Dockerfile
      args:
        WWWGROUP: "${WWWGROUP}"
    image: sail-8.0/app
    container_name: laravel_sail_shop
    ports:
      - "8084:80"
    environment:
      WWWUSER: "${WWWUSER}"
      LARAVEL_SAIL: 1
    volumes:
      - ".:/var/www/html"
    networks:
      - sail
    depends_on:
      - mysql
      - redis

And then in your .gitlab-ci.yml run commands like this instead of using Laravel Sail:

- docker exec laravel_sail_shop composer install
- docker exec laravel_sail_shop php artisan migrate --seed
- docker exec laravel_sail_shop php artisan cache:clear
- docker exec laravel_sail_shop php artisan config:clear
Pezhvak
  • 9,633
  • 7
  • 29
  • 39
-1

Found a fix for that, instead of using Laravel Envoy to proxy commands into the container, i ran it myself:

docker exec $(docker-compose ps -q) npm ci
Pezhvak
  • 9,633
  • 7
  • 29
  • 39