ready for production
This commit is contained in:
parent
2e272eb147
commit
be0e75b733
3 changed files with 19 additions and 4 deletions
|
@ -20,7 +20,9 @@ RUN add-apt-repository ppa:ondrej/php
|
||||||
RUN apt update
|
RUN apt update
|
||||||
|
|
||||||
# install app dependencies
|
# 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_CONNECTION=mysql
|
||||||
ENV DB_HOST=laraveldb
|
ENV DB_HOST=laraveldb
|
||||||
|
@ -35,10 +37,11 @@ RUN php artisan key:generate
|
||||||
# seed data if build arg is provided
|
# seed data if build arg is provided
|
||||||
RUN if [ "$SEED_DATA" = true ]; then php artisan migrate --seed; fi
|
RUN if [ "$SEED_DATA" = true ]; then php artisan migrate --seed; fi
|
||||||
|
|
||||||
EXPOSE 8000
|
|
||||||
|
|
||||||
RUN npm install
|
RUN npm install
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
#Open on port 8000 to all addresses
|
#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
|
||||||
|
|
9
docker/clean.sh
Executable file
9
docker/clean.sh
Executable file
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
docker stop laravel laraveldb
|
||||||
|
docker container rm laravel laraveldb
|
||||||
|
|
||||||
|
docker image rm laravelio
|
||||||
|
|
|
@ -25,6 +25,8 @@ then
|
||||||
docker build . -t laravelio
|
docker build . -t laravelio
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
sleep 5
|
||||||
|
|
||||||
docker run --name laravel --net laravel_net -p 80:8000 -d \
|
docker run --name laravel --net laravel_net -p 80:8000 -d \
|
||||||
-e DB_CONNECTION=mysql \
|
-e DB_CONNECTION=mysql \
|
||||||
-e DB_HOST=laraveldb \
|
-e DB_HOST=laraveldb \
|
||||||
|
@ -33,5 +35,6 @@ docker run --name laravel --net laravel_net -p 80:8000 -d \
|
||||||
-e DB_PASSWORD=password \
|
-e DB_PASSWORD=password \
|
||||||
laravelio
|
laravelio
|
||||||
|
|
||||||
|
sleep 5
|
||||||
curl --write-out '%{http_code}' --silent http://localhost:80/ --output output.html
|
curl --write-out '%{http_code}' --silent http://localhost:80/ --output output.html
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue