diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9bdc99d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +vendor +node_modules +.sqlite diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..39be549 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM php:7.4 + +WORKDIR /usr/src/app + +RUN apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y git + +COPY composer* ./ +RUN curl --silent --show-error https://getcomposer.org/installer | php +RUN mv composer.phar /usr/local/bin/composer + + +COPY . . +RUN make install + +EXPOSE 8000 + +CMD [ "php", "artisan", "serve", "--host=0.0.0.0" ] diff --git a/Makefile b/Makefile index 96afd80..92e7417 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,9 @@ install: - mkdir -p database touch database/database.sqlite touch database/database-test.sqlite composer install php artisan key:generate --force php artisan migrate --force - php artisan db:seed --force serve-setup: php artisan serve --host=127.0.0.1 diff --git a/composer.json b/composer.json index 8cbb6cb..8571ae0 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "TwilioDevEd/airtng-laravel", + "name": "twilio-deved/airtng-laravel", "description": "The Laravel Framework.", "keywords": ["twilio", "workflow", "airtng"], "license": "MIT", diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..3b6c6b8 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +version: "3.8" +services: + app: + restart: always + build: . + ports: + - "8000:8000" diff --git a/readme.md b/readme.md index d6354ee..5586279 100644 --- a/readme.md +++ b/readme.md @@ -104,6 +104,15 @@ After the above requirements have been met: That's it! +### Docker + +If you have [Docker](https://www.docker.com/) already installed on your machine, you can use our `docker-compose.yml` to setup your project. + +1. Make sure you have the project cloned. +2. Setup the `.env` file as outlined in the [Local Development](#local-development) steps. +3. Run `docker-compose up`. +4. Follow the steps in [Local Development](#local-development) on how to expose your port to Twilio using a tool like [ngrok](https://ngrok.com/) and configure the remaining parts of your application. + ### Unit and Integration Tests First, run the migrations for the testing database.