mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-19 04:14:04 +00:00
70f51bda58
added build npm in docker
28 lines
958 B
Docker
28 lines
958 B
Docker
# Build frontend assets
|
|
FROM node as frontend
|
|
WORKDIR /app
|
|
ADD . /app
|
|
RUN npm install
|
|
RUN npm run production
|
|
|
|
# Build backend
|
|
FROM php:7.1.3
|
|
RUN apt-get update -y && apt-get install -y openssl zip unzip git zlib1g-dev netcat mysql-client libgd-dev libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
|
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
|
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
|
|
RUN docker-php-ext-install pdo pdo_mysql zip gd
|
|
WORKDIR /app
|
|
ADD . /app
|
|
RUN chown -R www-data:www-data /app
|
|
RUN chmod 755 /app/storage
|
|
|
|
RUN composer install
|
|
RUN php artisan clear-compiled
|
|
|
|
COPY wait.sh /usr/local/bin/wait.sh
|
|
RUN chmod +x /usr/local/bin/wait.sh
|
|
RUN php artisan storage:link
|
|
|
|
CMD /usr/local/bin/wait.sh && composer update --no-scripts && composer dumpautoload && php artisan migrate && php artisan serve --host=0.0.0.0 --port=8000
|
|
EXPOSE 8000
|