Skip to content

Commit

Permalink
Add Docker deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Villavicencio committed Jun 5, 2020
1 parent 4e057ad commit 76dc9c7
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vendor
node_modules
.sqlite
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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 touch database/database.sqlite
RUN composer install --no-interaction

RUN php artisan key:generate --force
RUN php artisan migrate --force

EXPOSE 8000

CMD [ "php", "artisan", "serve", "--host=0.0.0.0" ]
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ install:
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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "TwilioDevEd/airtng-laravel",
"name": "twilio-deved/airtng-laravel",
"description": "The Laravel Framework.",
"keywords": ["twilio", "workflow", "airtng"],
"license": "MIT",
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: "3.8"
services:
app:
container_name: app
restart: always
build: .
ports:
- "8000:8000"
9 changes: 9 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 76dc9c7

Please sign in to comment.