javi98/laravel-server-juegos-api

By javi98

Updated about 2 years ago

Docker image Laravel aplication juegos api crud

Image
Languages & frameworks
Web servers
0

632

javi98/laravel-server-juegos-api repository overview

Laravel aplication api juegos crud

revive

Docker image Laravel api juegos crud

Github repository: https://github.com/JAVI-CC/Laravel-API-Server

Setup
$ git clone https://github.com/JAVI-CC/Laravel-API-Server.git
$ cd Laravel-API-Server
$ cp .env.example .env
$ docker-compose up -d
$ docker compose exec app chmod -R 777 /var/www/storage
$ docker-compose exec app php artisan key:generate
$ docker-compose exec app php artisan migrate --seed
$ docker-compose exec app php artisan test

In 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 .

docker-compose.yml
version: "3"
services:
  app:
    build:
      args:
        user: javi
        uid: 1000
      context: .
      dockerfile: Dockerfile
    image: javi98/laravel-server-juegos-api:1.0.0
    container_name: laravel-server-juegos-api-app
    restart: unless-stopped
    working_dir: /var/www/
    volumes:
      - ./:/var/www
      - /var/www/vendor
      - ./docker-config/php/php.ini:/usr/local/etc/php/conf.d/zzz-custom.ini
    depends_on:
      - db
  db:
    image: mariadb:11.2.2
    container_name: laravel-server-juegos-api-db
    restart: unless-stopped
    environment:
      MARIADB_DATABASE: ${DB_DATABASE}
      MARIADB_USER: ${DB_USERNAME}
      MARIADB_ROOT_PASSWORD: ${DB_PASSWORD}
    ports:
      - "${DB_PORT}:3306"
    volumes:
      - db-data:/var/lib/mysql
      - ./docker-config/mysql:/docker-entrypoint-initdb.d
  nginx:
    image: nginx:alpine
    container_name: laravel-server-juegos-api-web
    restart: unless-stopped
    ports:
      - "8000:80"
    volumes:
      - ./:/var/www
      - ./docker-config/nginx:/etc/nginx/conf.d
networks:
  laravel-server-juegos-api:
    driver: bridge
    # driver: host # laravel-client-juegos-api
volumes:
  db-data:

Once you have the containers deployed, you can access http://localhost:8000

Tag summary

Content type

Image

Digest

sha256:f35d5d489

Size

279.9 MB

Last updated

about 2 years ago

docker pull javi98/laravel-server-juegos-api