Skip to content

Commit

Permalink
First changes to be able to compile with new Angular frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
KlaasDijkstraOrdina committed Mar 19, 2024
1 parent 32dd7bf commit f287083
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
17 changes: 12 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# To run generated prototypes we require a apache webserver with php
FROM php:8.1-apache-bullseye
FROM php:8.3-apache-bullseye

RUN apt-get update \
&& apt-get install -y \
Expand Down Expand Up @@ -31,11 +31,13 @@ RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - \
&& npm -v

# Install Gulp-CLI (needed to package prototype framework frontend)
RUN npm install -g gulp-cli
#RUN npm install -g gulp-cli

# Install php backend dependencies using PHP Composer package specification (composer.json)
COPY composer.json composer.lock /var/www/
WORKDIR /var/www
RUN composer --version \
&& composer check-platform-reqs
RUN composer install --prefer-dist --no-dev --profile

# Install frontend dependencies using NPM package specification (package.json)
Expand All @@ -47,7 +49,7 @@ RUN npm install
# Soon we'll have the new frontend, so let's not spent any time fixing these issues for the old frontend.
# We set --audit-level=none to suppress
# Don't use --force as it will downgrade amongst others Gulp to v3. We need v4.
RUN npm audit fix --audit-level=none
#RUN npm audit fix --audit-level=none

# Copy Ampersand compiler
# NOTE! Also check/update constraints in compiler-version.txt when updating the compiler
Expand All @@ -66,5 +68,10 @@ RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf
COPY . /var/www

# Build ampersand frontend application
WORKDIR /var/www
RUN gulp build-ampersand
#WORKDIR /var/www
#RUN gulp build-ampersand

WORKDIR /var/www/frontend
#TODO Move frontend to root? Or change the workdir in the middle of the file? Laatste kan niet want /var/www base voor alles toch? WIP
RUN npm install

11 changes: 11 additions & 0 deletions frontend/apache-conf/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# See https://angular.io/guide/deployment
RewriteEngine On

# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]

# If the requested resource doesn't exist, use index.html
# For root folder use '/index.html'. For virtual directory use 'index.html' without slash
RewriteRule ^ index.html
File renamed without changes.

0 comments on commit f287083

Please sign in to comment.