dniccum

Software Engineer at Schier Products

Member Since 3 Years Ago

Experience Points
2,230
Total
Experience

2,770 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
15
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

  • Community Pillar

    Earned once your experience points ranks in the top 10 of all Laracasts users.

Level 1
2,230 XP
May
04
1 week ago
Activity icon

Started a new Conversation Laravel Mix 5.X Production Build Error In Docker Container

I am currently encountering an error during the production build process within a Docker container that I cannot explain. The logs are extremely ambiguous and don't' necessarily say what is going on. This is what I am seeing:

[webpack.Progress] 92% chunk asset optimization
[webpack.Progress] 92% chunk asset optimization TerserPlugin

npm ERR! code ELIFECYCLEnpm ERR! errno 1
npm ERR! @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`npm ERR! Exit status 1
npm ERR!
 npm ERR! Failed at the @ production script.
npm

ERR! This is probably not a problem with npm. There is likely additional logging output above.

I have tested the development build process (yarn dev) and everything works just fine. I am having no issues on my local environment outside of the Docker container. I have also ran yarn upgrade and this has not had any affect.

Any help would be appreciated.

Version of Node

12.13

Version of Mix

5.0.4

Debug logs

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'production' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'preproduction', 'production', 'postproduction' ]
5 info lifecycle @~preproduction: @
6 info lifecycle @~production: @
7 warn lifecycle The node binary used for scripts is /tmp/yarn--1620154751186-0.19642695221228879/node but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
8 verbose lifecycle @~production: unsafe-perm in lifecycle true
9 verbose lifecycle @~production: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/ops/node_modules/.bin:/tmp/yarn--1620154751186-0.19642695221228879:/ops/node_modules/.bin:/usr/local/share/.config/yarn/link/node_modules/.bin:/usr/local/libexec/lib/node_modules/npm/bin/node-gyp-bin:/usr/local/lib/node_modules/npm/bin/node-gyp-bin:/usr/local/bin/node_modules/npm/bin/node-gyp-bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
10 verbose lifecycle @~production: CWD: /ops
11 silly lifecycle @~production: Args: [
11 silly lifecycle   '-c',
11 silly lifecycle   'cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'
11 silly lifecycle ]
12 silly lifecycle @~production: Returned: code: 1  signal: null
13 info lifecycle @~production: Failed to exec production script
14 verbose stack Error: @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
14 verbose stack     at EventEmitter.emit (events.js:210:5)
14 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
14 verbose stack     at ChildProcess.emit (events.js:210:5)
14 verbose stack     at maybeClose (internal/child_process.js:1021:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
15 verbose pkgid @
16 verbose cwd /ops
17 verbose Linux 5.10.25-linuxkit
18 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "production"
19 verbose node v12.13.1
20 verbose npm  v6.12.1
21 error code ELIFECYCLE
22 error errno 1
23 error @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
23 error Exit status 1
24 error Failed at the @ production script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]

Feb
08
3 months ago
Activity icon

Awarded Best Reply on MySQL Not Found In Docker Container

The MySQL client was not installed on the PHP container. So to fix my issue I added the following to my Dockerfile:

RUN apt-get install -y default-mysql-client

I then added the command property to the db service:

command: '--default-authentication-plugin=mysql_native_password'

I am successfully able to run my migrations now.

Activity icon

Replied to MySQL Not Found In Docker Container

The MySQL client was not installed on the PHP container. So to fix my issue I added the following to my Dockerfile:

RUN apt-get install -y default-mysql-client

I then added the command property to the db service:

command: '--default-authentication-plugin=mysql_native_password'

I am successfully able to run my migrations now.

Activity icon

Replied to MySQL Not Found In Docker Container

I do want want to use Sail as I am looking to stand up a testing environment on Kubernetes.

Activity icon

Replied to MySQL Not Found In Docker Container

Yes, I can log in with the mysql -u homestead -p command and look at the tables within the container.

Feb
04
3 months ago
Activity icon

Replied to MySQL Not Found In Docker Container

This was the command that I was using:

docker-compose exec app php artisan migrate --force
Activity icon

Awarded Best Reply on Nova Tool Script 502 Error On Vapor

After chatting to Mohamed at Laravel, he said that because we are using a wildcard subdomain, the API Gateway and/or LoadBalancer payload is limit is 1MB. That is why I was receiving the 502 errors in production.

Activity icon

Replied to Nova Tool Script 502 Error On Vapor

After chatting to Mohamed at Laravel, he said that because we are using a wildcard subdomain, the API Gateway and/or LoadBalancer payload is limit is 1MB. That is why I was receiving the 502 errors in production.

Activity icon

Replied to MySQL Not Found In Docker Container

I added my .env file in the initial post. The host was in fact set to db.

Activity icon

Started a new Conversation MySQL Not Found In Docker Container

I am currently working adding Docker support to one of my apps. I feel like I am really close. The Docker container builds fine with no errors but when I try to run the database migrations within the container, I get this error:

Error Output:
================
sh: 1: mysql: not found

Any help would be appreciated.

docker-compose.yml

version: '3'
services:

  #PHP Service
  app:
    build:
      context: .
      dockerfile: Dockerfile
    image: schierproducts/grease-monkey
    container_name: app
    restart: unless-stopped
    tty: true
    environment:
      APP_ENV: local
      APP_DEBUG: 1
      DB_DATABASE: greasemonkey
      SERVICE_NAME: app
      SERVICE_TAGS: dev
    working_dir: /var/www
    volumes:
      - ./:/var/www
      - ./docker/php/local.ini:/usr/local/etc/php/conf.d/local.ini
    networks:
      - app-network
    depends_on:
      - db

  #Nginx Service
  webserver:
    image: nginx:alpine
    container_name: webserver
    restart: unless-stopped
    tty: true
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./:/var/www
      - ./docker/nginx/conf.d/:/etc/nginx/conf.d/
    networks:
      - app-network

  #MySQL Service
  db:
    image: mysql:8.0.23
    container_name: db
    restart: unless-stopped
    tty: true
    ports:
      - "3306:3306"
    environment:
      MYSQL_DATABASE: greasemonkey
      MYSQL_ROOT_PASSWORD: secret
      MYSQL_USER: homestead
      MYSQL_PASSWORD: secret
      SERVICE_TAGS: dev
      SERVICE_NAME: mysql
    networks:
      - app-network
    volumes:
      - dbdata:/var/lib/mysql-files
      - ./docker/mysql/my.cnf:/etc/mysql/my.cnf
      - ./docker/db/init:/docker-entrypoint-initdb.d/:ro

  #Redis Service
  redis:
    image: redis:alpine
    ports:
      - '6379:6379'
    volumes:
      - redisdata:/data
    networks:
      - app-network
    healthcheck:
      test: [ "CMD", "redis-cli", "ping" ]

#Docker Networks
networks:
  app-network:
    driver: bridge

#Volumes
volumes:
  dbdata:
    driver: local
  redisdata:
    driver: local

Dockerfile

FROM php:7.4.14-fpm

# Copy composer.lock and composer.json
COPY composer.lock composer.json /var/www/

# Set working directory
WORKDIR /var/www

# Install dependencies
RUN apt-get update && apt-get install -y \
    gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin python2 yarn libzip-dev \
    libfreetype6-dev \
    libjpeg62-turbo-dev \
    libpng-dev

# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

# Install extensions
RUN docker-php-ext-install mysqli pdo pdo_mysql zip exif pcntl
RUN docker-php-ext-enable pdo_mysql mysqli
RUN docker-php-ext-configure gd --with-freetype --with-jpeg
RUN docker-php-ext-install gd

# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

# Add user for laravel application
RUN groupadd -g 1000 www
RUN useradd -u 1000 -ms /bin/bash -g www www

# Copy existing application directory contents
COPY . /var/www
COPY docker/start.sh /usr/local/bin/start

# Copy existing application directory permissions
COPY --chown=www:www . /var/www

# Updates permissions and runs start command
USER root
RUN chmod u+x /usr/local/bin/start
CMD [ "/usr/local/bin/start" ]

# Change current user to www
USER www

# Expose port 9000 and start php-fpm server
EXPOSE 9000
CMD ["php-fpm"]

My .env file:

DB_HOST=db
DB_PORT=3306
DB_DATABASE=greasemonkey
DB_USERNAME=homestead
DB_PASSWORD=secret
Dec
07
5 months ago
Activity icon

Started a new Conversation Nova Tool Script 502 Error On Vapor

I am about to release a new version of a Nova Tool that I have developed and I wanted to give it a spin on an application that I have set up on Vapor. The tool is somewhat complex and thus requires a lot of Javascript; about 1.2MB when minified.

I am currently getting a 502 Error when attempting to view the app in the environment. I can confirm that this is isolated to Vapor as it works fine on my local and Forge. Additionally I reached to Support and Mohamed said that I should be seeing the issue in my logs, which I do not.

Has anyone come across this?