22 lines
717 B
Docker
22 lines
717 B
Docker
FROM node:22-alpine AS builder
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm install
|
|
COPY assets/ ./assets/
|
|
COPY templates/ ./templates/
|
|
|
|
# JS bauen
|
|
RUN ./node_modules/.bin/esbuild ./assets/javascript/test.js --bundle --outfile=./public/build/app.js --minify
|
|
|
|
# CSS bauen
|
|
RUN ./node_modules/.bin/tailwindcss -i ./assets/css/app.css -o ./public/build/app.css --minify
|
|
|
|
FROM php:8.3-apache
|
|
RUN a2enmod rewrite
|
|
RUN docker-php-ext-install pdo_mysql
|
|
COPY . /var/www/html
|
|
COPY --from=builder /app/public/build /var/www/html/public/build
|
|
RUN sed -i 's|/var/www/html|/var/www/html/public|g' \
|
|
/etc/apache2/sites-available/000-default.conf
|
|
RUN sed -i 's|AllowOverride None|AllowOverride All|g' \
|
|
/etc/apache2/apache2.conf |