todo/Dockerfile

52 lines
1.1 KiB
Docker
Raw Normal View History

2022-02-06 07:31:06 +00:00
FROM php:7.4-apache
RUN apt-get update
# 1. development packages
2022-04-13 00:06:43 +00:00
RUN apt-get install -y git
2022-04-13 00:04:47 +00:00
# zip \
# curl \
# sudo \
# unzip \
# libicu-dev \
# libzip-dev \
# libbz2-dev \
# libpng-dev \
# libjpeg-dev \
# libmcrypt-dev \
# libreadline-dev \
# libfreetype6-dev \
# g++
2022-02-06 07:31:06 +00:00
# Set Apache Root
ENV APACHE_DOCUMENT_ROOT=/var/www/html/public
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
# Enable Some Apache Mod
RUN a2enmod rewrite headers
2022-04-12 23:56:17 +00:00
#RUN docker-php-ext-install \
# bz2 \
# intl \
# iconv \
# bcmath \
# opcache \
# calendar \
# pdo_mysql \
# zip
2022-02-06 07:31:06 +00:00
# Composer
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
# Copy Source Code
COPY .env.docker /var/www/html/.env
COPY . /var/www/html
# Change Working Directory
WORKDIR /var/www/html
# Composer install and generate key
2022-04-12 23:56:17 +00:00
RUN composer install --optimize-autoloader --no-dev && php artisan key:generate
2022-02-06 07:31:06 +00:00
RUN chown -R www-data:www-data /var/www/html