| 1 |
|
FROM composer:latest AS composer_installer |
| 2 |
|
|
| 3 |
|
# Set working directory |
| 4 |
|
RUN mkdir -p /usr/local/composer |
| 5 |
|
|
| 6 |
|
WORKDIR /usr/local/composer |
| 7 |
|
|
| 8 |
|
COPY ./composer.json ./composer.lock ./ |
| 9 |
|
RUN /usr/bin/composer install --prefer-dist --no-scripts --no-progress |
| 10 |
|
|
| 11 |
# Use the official Apache image |
# Use the official Apache image |
| 12 |
FROM httpd:2.4 |
FROM httpd:2.4 |
| 13 |
|
|
| 16 |
RUN sed -i 's/#Include conf\/extra\/httpd-vhosts.conf/Include conf\/extra\/httpd-vhosts.conf/' /usr/local/apache2/conf/httpd.conf |
RUN sed -i 's/#Include conf\/extra\/httpd-vhosts.conf/Include conf\/extra\/httpd-vhosts.conf/' /usr/local/apache2/conf/httpd.conf |
| 17 |
|
|
| 18 |
# Copy web application files |
# Copy web application files |
|
RUN mkdir -p /var/www/html/gen_ex |
|
| 19 |
COPY ./bbs /var/www/html/bbs |
COPY ./bbs /var/www/html/bbs |
| 20 |
COPY ./conf /var/www/html/conf |
COPY ./gen_ex /var/www/html/gen_ex |
|
COPY ./gen_ex/*.css /var/www/html/gen_ex/ |
|
| 21 |
COPY ./js /var/www/html/js |
COPY ./js /var/www/html/js |
| 22 |
COPY ./lib /var/www/html/lib |
COPY ./lib /var/www/html/lib |
| 23 |
COPY ./manage /var/www/html/manage |
COPY ./manage /var/www/html/manage |
| 24 |
RUN mkdir -p /var/www/html/bbs/cache /var/www/html/bbs/upload /var/www/html/stat |
RUN mkdir -p /var/www/html/bbs/cache \ |
| 25 |
|
/var/www/html/bbs/upload \ |
| 26 |
|
/var/www/html/bbs/images/face/upload_photo \ |
| 27 |
|
/var/www/html/conf /var/www/html/stat |
| 28 |
|
|
| 29 |
|
# Copy the composer binary from the installer stage into your final image |
| 30 |
|
COPY --from=composer_installer /usr/local/composer/vendor /var/www/html/vendor |
| 31 |
|
|
| 32 |
# Set ownership to www-data user and group |
# Set ownership to www-data user and group |
| 33 |
RUN chown -R www-data:www-data /var/www/html |
RUN chown -R www-data:www-data /var/www/html |