ready for production

This commit is contained in:
Tiago Sousa 2023-11-07 19:34:50 +00:00
parent 2e272eb147
commit be0e75b733
3 changed files with 19 additions and 4 deletions

View file

@ -20,7 +20,9 @@ RUN add-apt-repository ppa:ondrej/php
RUN apt update
# install app dependencies
RUN DEBIAN_FRONTEND=noninteractive TZ=Europe/Lisbon apt install 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 php8.2-mysql composer npm \
mysql-client -y
ENV DB_CONNECTION=mysql
ENV DB_HOST=laraveldb
@ -35,10 +37,11 @@ RUN php artisan key:generate
# seed data if build arg is provided
RUN if [ "$SEED_DATA" = true ]; then php artisan migrate --seed; fi
EXPOSE 8000
RUN npm install
RUN npm run build
#Open on port 8000 to all addresses
ENTRYPOINT php artisan serve --port=8000 --host=0.0.0.0
# COPY entrypoint.sh .
# RUN chmod +x entrypoint.sh
ENTRYPOINT php artisan migrate --seed; php artisan serve --port=8000 --host=0.0.0.0
EXPOSE 8000