ipunkt / docker-laravel-queue-worker

A docker image for working with queues being monitored by supervisor as recommended by laravel.
https://hub.docker.com/r/ipunktbs/laravel-queue-worker/
MIT License
71 stars 20 forks source link

How i use this in my dockerfile? #9

Open hamza-younas94 opened 4 years ago

hamza-younas94 commented 4 years ago

HI, I saw your package i already have dockerfile and i just want to add this feature .

FROM php:7.2-fpm

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

COPY docker-entry.sh /
RUN chmod +x /docker-entry.sh

# Set working directory
WORKDIR /var/www
# Install dependencies
RUN apt-get update && apt-get install -y \
    build-essential \
    libpng-dev \
    libpq-dev \
    libjpeg62-turbo-dev \
    libfreetype6-dev \
    locales \
    zip \
    jpegoptim optipng pngquant gifsicle \
    vim \
    unzip \
    git \
    curl \
    nginx \
    libxml2-dev

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

# Install extensions
RUN docker-php-ext-install pdo_mysql pdo_pgsql mbstring zip exif pcntl
#RUN docker-php-ext-configure gd --with-gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/
RUN docker-php-ext-install soap
RUN docker-php-ext-install gd pdo_mysql pdo_pgsql mbstring zip exif pcntl
# 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

RUN adduser --disabled-password --gecos '' hamza
# Copy existing application directory
COPY . /var/www/
RUN ls /var/www
RUN chown hamza:www /var/www/storage/logs

COPY ./configuration/nginx/conf.d/ /etc/nginx/conf.d/
RUN ls /etc/nginx/conf.d

COPY ./configuration/php/local.ini /usr/local/etc/php/conf.d/local.ini
RUN ls /usr/local/etc/php/conf.d
RUN cat /usr/local/etc/php/conf.d/local.ini

RUN rm -rf /etc/nginx/sites-enabled/default
#RUN mkdir -p /etc/nginx/sites-enabled
#COPY ./configuration/nginx/conf.d/default /etc/nginx/sites-enabled

RUN mkdir -p /var/www/storage/app/public/posters
RUN chmod -R 775 /var/www/storage
RUN composer install

# install node
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash
#RUN echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list
RUN apt-get update && apt-get install -y  nodejs

#install node modules and run dev

RUN npm install
RUN npm run production

#RUN php artisan  migrate:fresh
#RUN php artisan  db:seed
RUN php artisan cache:clear

WORKDIR /var/www/public
#RUN rm storage
WORKDIR /var/www/
RUN php artisan storage:link

# Expose port 80 and start php-fpm server
EXPOSE 80

COPY bootstart.sh /
RUN chmod +x /bootstart.sh

#ENTRYPOINT ["/bootstart.sh"]

CMD ["/docker-entry.sh"]
rokde commented 4 years ago

Which feature do you want to add?