Docker image Laravel aplication api crud template
1.7K
Docker image Laravel aplication api crud template
Github repository: https://github.com/JAVI-CC/laravel-api-crud-template
$ git clone https://github.com/JAVI-CC/laravel-api-crud-template
$ cd laravel-api-crud-template
$ cp .env.example .env
$ docker-compose up -d
$ docker compose exec app chmod +x ./docker-config/run.sh
$ docker compose exec app ./docker-config/run.shIn case you are using your IDE to develop the application and it odes not detect the files it contains within the vendor folder, you have to copy the files from the vendor folder of the container to the host machine with the following command.
$ docker compose cp app:/var/www/vendor .version: '3'
services:
app:
build:
args:
user: javi
uid: 1000
context: .
dockerfile: Dockerfile
image: javi98/laravel-api-crud-template:1.0.8
container_name: laravel-api-crud-template-app
restart: unless-stopped
volumes:
- ./:/var/www
- /var/www/vendor
- ./docker-config/php/php.ini:/usr/local/etc/php/conf.d/zzz-custom.ini
depends_on:
- db
- smtp
- soketi
nginx:
image: nginx:alpine
container_name: laravel-api-crud-template-web
restart: unless-stopped
ports:
- "8000:80"
volumes:
- ./:/var/www
- ./docker-config/nginx/conf.d/:/etc/nginx/conf.d/
db:
image: mariadb:11.2.2
container_name: laravel-api-crud-template-db
restart: unless-stopped
environment:
MARIADB_DATABASE: ${DB_DATABASE}
MARIADB_ROOT_PASSWORD: ${DB_PASSWORD}
ports:
- "3306:3306"
volumes:
- ./docker-config/mariadb/init:/docker-entrypoint-initdb.d
- db-data:/var/lib/mysql
smtp:
image: jcalonso/mailhog:v1.0.1
container_name: laravel-api-crud-template-smtp
restart: unless-stopped
ports:
- "1025:1025" # smtp server
- "8025:8025" # web ui
environment:
MH_STORAGE: maildir
MH_MAILDIR_PATH: /home/mailhog
volumes:
- smtp-data:/home/mailhog
soketi:
image: quay.io/soketi/soketi:1.6-16-debian
container_name: laravel-api-crud-template-soketi
restart: unless-stopped
ports:
- "${SOKETI_PORT:-6001}:6001"
- "${SOKETI_METRICS_SERVER_PORT:-9601}:9601"
environment:
SOKETI_DEBUG: "1"
SOKETI_METRICS_SERVER_PORT: "9601"
volumes:
- './docker-config/soketi/config.json:/opt/config.json'
command: ["node", "/app/bin/server.js", "start", "--config=/opt/config.json"]
redis:
image: redis:7.2.4
container_name: laravel-api-crud-template-redis
restart: unless-stopped
volumes:
- ./docker-config/redis/redis.conf:/etc/redis/redis.conf
- redis-data:/data
ports:
- "6379:6379"
command: ["redis-server", "/etc/redis/redis.conf"]
phpmyadmin:
image: phpmyadmin:5.2.1
container_name: laravel-api-crud-template-phpmyadmin
restart: unless-stopped
ports:
- 8085:80
environment:
PMA_ARBITRARY: 1
UPLOAD_LIMIT: 350M
depends_on:
- db
networks:
laravel-api-crud-template:
driver: bridge
volumes:
db-data:
smtp-data:
Once you have the containers deployed, you can access http://localhost:8000
Url to access MailHog: http://localhost:8025
Content type
Image
Digest
sha256:ec00a8cf4…
Size
298.3 MB
Last updated
over 2 years ago
docker pull javi98/laravel-api-crud-template