Files
exchange/Dockerfile
2018-08-24 11:09:26 +08:00

28 lines
977 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 chmod 755 /app/storage
RUN chmod 777 -R /app/bootstrap/cache
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 chown -R www-data:www-data /app
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