<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lucas Quadros</title>
    <description>The latest articles on DEV Community by Lucas Quadros (@olucasquadros).</description>
    <link>https://dev.to/olucasquadros</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F971438%2F7da328a8-83fc-4a3f-b77b-2aa191126943.jpeg</url>
      <title>DEV Community: Lucas Quadros</title>
      <link>https://dev.to/olucasquadros</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/olucasquadros"/>
    <language>en</language>
    <item>
      <title>Setting up WordPress with Docker</title>
      <dc:creator>Lucas Quadros</dc:creator>
      <pubDate>Wed, 23 Aug 2023 16:23:52 +0000</pubDate>
      <link>https://dev.to/olucasquadros/setting-up-wordpress-with-docker-2b9i</link>
      <guid>https://dev.to/olucasquadros/setting-up-wordpress-with-docker-2b9i</guid>
      <description>&lt;p&gt;Docker simplifies the process of setting up and managing software across different environments. By using Docker containers, you can ensure that your WordPress site will run the same, regardless of where Docker is running.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Docker installed on your machine.&lt;/li&gt;
&lt;li&gt;Docker Compose installed on your machine.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Steps:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a Docker Compose File:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Start by creating a new directory for your WordPress project and navigate into it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir my_wordpress_site &amp;amp;&amp;amp; cd my_wordpress_site
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, create a docker-compose.yml file in this directory with the following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;version: '3'

services:
  db:
    image: mysql:5.7
    volumes:
      - db_data:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: somewordpress
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress

  wordpress:
    depends_on:
      - db
    image: wordpress:latest
    ports:
      - "8000:80"
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
      WORDPRESS_DB_NAME: wordpress
    volumes:
      - ./wp-content:/var/www/html/wp-content

volumes:
  db_data: {}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Start Your Containers:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the terminal, navigate to the directory where your docker-compose.yml is located and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker-compose up -d

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will start your WordPress and MySQL containers. The -d flag will run them in the background.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3.Access WordPress:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once the containers are up and running, open your browser and go to &lt;strong&gt;&lt;a href="http://localhost:8000"&gt;http://localhost:8000&lt;/a&gt;&lt;/strong&gt;. You should see the WordPress installation page. Proceed with the installation by following the on-screen instructions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.Stopping the Containers:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you're done, you can stop the containers by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker-compose down

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;br&gt;
By using Docker with WordPress, you can quickly set up a development environment without the need for manual configuration or the risk of conflicts with other software. This setup ensures consistency across different machines and can be a foundation for more advanced Docker deployments in the future.&lt;/p&gt;

&lt;p&gt;Espero que este guia básico seja útil para você! Há muito mais que você pode fazer com Docker e WordPress, como configurar certificados SSL, otimizar o desempenho e integrar com outras ferramentas.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
