diff --git a/codebase/docker/Dockerfile b/codebase/docker/Dockerfile index f290d61..584cccc 100644 --- a/codebase/docker/Dockerfile +++ b/codebase/docker/Dockerfile @@ -1,5 +1,6 @@ # Dockerfile for the laravel.io application +ARG SEED_DATA=false FROM ubuntu:22.04 RUN apt update @@ -16,7 +17,7 @@ RUN add-apt-repository ppa:ondrej/php RUN apt update # install app dependencies -RUN DEBIAN_FRONTEND=noninteractive TZ=Europe/Lisbon apt install tzdata php8.2 php8.2-simplexml php8.2-curl php8.2-dom composer npm -y +RUN DEBIAN_FRONTEND=noninteractive TZ=Europe/Lisbon apt install php8.2 php8.2-simplexml php8.2-curl php8.2-dom composer npm -y ENV DB_CONNECTION=mysql ENV DB_HOST=laraveldb @@ -26,6 +27,13 @@ ENV DB_PASSWORD=password RUN composer install -RUN composer setup +RUN mv .env.example .env +RUN php artisan key:generate + +# seed data if build arg is provided +RUN if [ $SEED_DATA = true ]; then php artisan migrate --seed; fi + +RUN npm install +RUN npm run build EXPOSE 8000