fixed composer setup and added build arg to seed data
This commit is contained in:
parent
59fc9c9636
commit
deb800348f
1 changed files with 10 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue