Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile implementation #13

Open
wants to merge 18 commits into
base: docker
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
177 changes: 177 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
# Created by https://www.toptal.com/developers/gitignore/api/node,laravel

### Laravel ###
node_modules/
npm-debug.log
yarn-error.log

# Laravel 4 specific
bootstrap/compiled.php
app/storage/

# Laravel 5 & Lumen specific
public/storage
public/hot

# Laravel 5 & Lumen specific with changed public path
public_html/storage
public_html/hot

storage/*.key
Homestead.yaml
Homestead.json
/.vagrant
.phpunit.result.cache

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

### Node Patch ###
# Serverless Webpack directories
.webpack/

# Optional stylelint cache

# SvelteKit build / generate output
.svelte-kit

# Dockerfiles
dockerfiles/
.dockerignore
docker.sh
docker-compose.yaml

# Misc files or folders
README.md
LICENSE
go.sh
.editorconfig
.gitattributes
.gitignore
.github/
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ yarn-error.log
.idea
composer.lock
.DS_Store
.DS_Store
initialized
120 changes: 120 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
version: '3'

networks:
laravel:


services:
nginx:
build:
context: ./dockerfiles
dockerfile: nginx.dockerfile
args:
- UID=${UID:-1000}
- GID=${GID:-1000}
ports:
- "80:80"
volumes:
- .:/var/www/html
- ./dockerfiles/nginx/:/etc/nginx/conf.d/
depends_on:
- php
networks:
- laravel

mysql:
image: mariadb:10.6
restart: unless-stopped
tty: true
ports:
- "3306:${DB_PORT}"
environment:
MYSQL_DATABASE: "${DB_DATABASE}"
MYSQL_USER: "${DB_USERNAME}"
MYSQL_PASSWORD: "${DB_PASSWORD}"
MYSQL_ROOT_PASSWORD: "${DB_PASSWORD}"
SERVICE_TAGS: dev
SERVICE_NAME: "${DB_CONNECTION}"
networks:
- laravel

php:
build:
context: .
dockerfile: ./dockerfiles/php.dockerfile
args:
- UID=${UID:-1000}
- GID=${GID:-1000}
- APP_DEBUG=${APP_DEBUG:-false}
restart: unless-stopped
ports:
- "9000:9000"
expose:
- 9000
volumes:
- .:/var/www/html
depends_on:
- mysql

networks:
- laravel

redis:
image: redis:alpine
restart: unless-stopped
ports:
- "6379:6379"
networks:
- laravel
composer:
build:
context: .
dockerfile: ./dockerfiles/php.dockerfile
args:
- UID=${UID:-1000}
- GID=${GID:-1000}
volumes:
- .:/var/www/html
depends_on:
- php
entrypoint: [ 'composer', '--ignore-platform-reqs' ]
networks:
- laravel

npm:
image: node:current-alpine
dns:
- 8.8.8.8
volumes:
- .:/var/www/html
ports:
- "3000:3000"
- "3001:3001"
- "5173:5173"
working_dir: /var/www/html
entrypoint: [ 'npm' ]
networks:
- laravel

artisan:
build:
context: .
dockerfile: ./dockerfiles/php.dockerfile
args:
- UID=${UID:-1000}
- GID=${GID:-1000}
volumes:
- .:/var/www/html:delegated
depends_on:
- mysql
entrypoint: [ 'php', '/var/www/html/artisan' ]
networks:
- laravel

mailhog:
image: mailhog/mailhog:latest
ports:
- "1025:1025"
- "8025:8025"
networks:
- laravel
49 changes: 49 additions & 0 deletions docker.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
APP_NAME="Spikster Control Panel"
APP_ENV=local
APP_KEY=
APP_DEBUG=false
APP_URL=http://localhost

LOG_CHANNEL=stack
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=mysql # Points to the running docker container name
DB_PORT=3306
DB_DATABASE=laravel_db
DB_USERNAME=laravel
DB_PASSWORD=laravel

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=database
SESSION_DRIVER=database
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
Loading