website/Dockerfile
2021-04-13 11:46:08 +02:00

43 lines
1.7 KiB
Docker

# Bootstrap SCSS + TS
FROM node:latest AS build
WORKDIR /build
COPY . /build
RUN mkdir /build/public/js
RUN mkdir /build/public/css
RUN yarn install
RUN yarn compile
# Prepare Webserver
FROM php:8-apache-buster
# |--------------------------------------------------------------------------
# | install php extensions
# |--------------------------------------------------------------------------
RUN docker-php-ext-install mysqli
# |--------------------------------------------------------------------------
# | enable production php ini
# |--------------------------------------------------------------------------
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
# |--------------------------------------------------------------------------
# | copy website from node build
# |--------------------------------------------------------------------------
COPY --from=build /build/public /var/www/html
# |--------------------------------------------------------------------------
# | enable apache modules
# |--------------------------------------------------------------------------
RUN a2enmod headers rewrite
# |--------------------------------------------------------------------------
# | install bad bot blocklist
# |--------------------------------------------------------------------------
ADD ["https://raw.githubusercontent.com/mitchellkrogza/apache-ultimate-bad-bot-blocker/master/install-apacheblocker.sh", "/tmp/"]
RUN apt update && apt install -y wget && chmod +x /tmp/install-apacheblocker.sh && /tmp/install-apacheblocker.sh
# |--------------------------------------------------------------------------
# | expose http port
# |--------------------------------------------------------------------------
EXPOSE 80