https://github.com/chocapikk/projet-docker
Projet Docker pour implémenter un docker-compose qui créé un wordpress avec un mysql.
https://github.com/chocapikk/projet-docker
Last synced: 3 days ago
JSON representation
Projet Docker pour implémenter un docker-compose qui créé un wordpress avec un mysql.
- Host: GitHub
- URL: https://github.com/chocapikk/projet-docker
- Owner: Chocapikk
- Created: 2023-06-23T20:06:21.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-30T15:43:00.000Z (over 2 years ago)
- Last Synced: 2025-02-05T21:53:38.245Z (11 months ago)
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Deploying WordPress with Docker
This repository contains the necessary files to deploy a WordPress site using Docker and Docker Compose.
## Prerequisites
- Docker
- Docker Compose
## File `docker-compose.yml` Description
The `docker-compose.yml` file contains configuration for two services: `wordpress` and `db`.
- The `wordpress` service uses the official WordPress image, exposes port 8080 and sets the necessary environment variables for connecting to the database. Data is persisted using a volume named `wordpress`.
- The `db` service uses the MySQL 5.7 image, sets the environment variables for the database and user creation, and persists the data using a volume named `db`.
The database credentials are pre-set in the configuration, you don't need to modify them unless you wish to.
## Usage
1. Clone this repository on your system.
```sh
git clone https://github.com/Chocapikk/projet-docker.git
```
2. Navigate into the project directory.
```sh
cd projet-docker
```
3. Run Docker Compose to start up the Docker services.
```sh
sudo docker-compose up --build -d --remove-orphans
```
After running these commands, WordPress and MySQL will be running in separate Docker containers. You can access your WordPress site by navigating to `http://localhost:8080` in your web browser.
Please note that on the first run, you will need to go through the WordPress installation process, which will ask for the username and password set in the `docker-compose.yml` file.