Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tijani891/laravel-setup-using-docker
https://github.com/tijani891/laravel-setup-using-docker
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/tijani891/laravel-setup-using-docker
- Owner: Tijani891
- Created: 2023-02-12T09:03:17.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-18T20:44:38.000Z (almost 2 years ago)
- Last Synced: 2023-12-31T10:33:16.178Z (about 1 year ago)
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Deploying Laravel Application with Docker
This repository contains the files required to deploy a Laravel application using Docker. The deployment consists of a Dockerfile and a docker-compose.yml file.
## Prerequisites
Before deploying the Laravel application using Docker, you need to have the following prerequisites installed on your machine:- Docker
- Docker Compose## Deployment Steps
Follow the below steps to deploy the Laravel application using Docker:1. Clone the repository to your local machine.
2. Navigate to the root directory of the cloned repository.
3. Build the Docker image by running the following command:
\
`docker build -t `
4. Start the containers using Docker Compose by running the following command:
\
`docker-compose up -d`
5. Visit http://:8080 in your web browser to see the Laravel application running.## Dockerfile
The Dockerfile contains the instructions required to build the Docker image. It includes:
1. A base image of PHP with Apache installed.
2. Installation of necessary packages.
3. Copying the Laravel application files to the container.
4. Setting up the working directory.
5. Setting up the Apache virtual host.## docker-compose.yml
The docker-compose.yml file defines the Docker services required to run the Laravel application. It includes:- A service for the PHP application container.
- A service for the MySQL database container.
- Configuration for the volumes to be mounted.## Configuration
You can configure the Laravel application by modifying the .env file. Make sure to update the database credentials and other settings as necessary.
## Conclusion
That's it! You have now successfully deployed a Laravel application using Docker. If you have any issues, please refer to the Docker documentation or the Laravel documentation for further guidance.