<?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: My Nguyen</title>
    <description>The latest articles on DEV Community by My Nguyen (@nguyenducmy).</description>
    <link>https://dev.to/nguyenducmy</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%2F248115%2F6a4cde4c-f5a0-40a3-b76e-c65cacc00aa6.jpeg</url>
      <title>DEV Community: My Nguyen</title>
      <link>https://dev.to/nguyenducmy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nguyenducmy"/>
    <language>en</language>
    <item>
      <title>Hello World in Java</title>
      <dc:creator>My Nguyen</dc:creator>
      <pubDate>Sat, 23 Sep 2023 07:11:32 +0000</pubDate>
      <link>https://dev.to/nguyenducmy/hello-world-in-java-41o1</link>
      <guid>https://dev.to/nguyenducmy/hello-world-in-java-41o1</guid>
      <description>&lt;p&gt;In this series, I will guide you to learn Java from basic to advanced, I will help you cover it all from beginning to end. forms the foundation for us to develop Web applications or applications using the Java language.&lt;/p&gt;

&lt;p&gt;From the Windows search box, open the terminal and type cmd.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--j9EwOgMU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ci0i5g4teestgtni2aft.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--j9EwOgMU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ci0i5g4teestgtni2aft.png" alt="Image description" width="411" height="117"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;System.out.print("Hello World");&lt;br&gt;
Hello World&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In Java, newline characters will not be distinguished, but a comma will be required.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--A1tvCzE---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j8qksbtyx8vbr3ogf2xz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A1tvCzE---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j8qksbtyx8vbr3ogf2xz.png" alt="Image description" width="376" height="102"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Typing forward slash and the word 'exit', or forward slash with the shortcut text ex, will end your JShell session, if you get stuck.&lt;br&gt;
An example would be /exit or /ex.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sm8C1slP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jlgv8kh52z5pmg5ylvd9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sm8C1slP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jlgv8kh52z5pmg5ylvd9.png" alt="Image description" width="492" height="228"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Setup WordPress Environment With Docker Composer</title>
      <dc:creator>My Nguyen</dc:creator>
      <pubDate>Thu, 24 Aug 2023 12:38:37 +0000</pubDate>
      <link>https://dev.to/nguyenducmy/setup-wordpress-environment-with-docker-composer-11na</link>
      <guid>https://dev.to/nguyenducmy/setup-wordpress-environment-with-docker-composer-11na</guid>
      <description>&lt;p&gt;To set up a WordPress development environment with Docker Compose, follow these steps:&lt;/p&gt;

&lt;h3&gt;
  
  
  Install Docker and Docker Compose
&lt;/h3&gt;

&lt;p&gt;on your machine if you haven't already. You can download them from the official &lt;a href="https://www.docker.com/"&gt;&lt;u&gt;Docker website&lt;/u&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a new directory where you want to set up your WordPress development environment
&lt;/h3&gt;

&lt;p&gt;.&lt;br&gt;
&lt;code&gt;$mkdir -p Dev.to/Docker-Wp&lt;/code&gt;&lt;br&gt;
&lt;code&gt;$cd Dev.to/Docker-Wp&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Create a new file called &lt;code&gt;docker-compose.yml&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;in the directory and open it in a text editor.&lt;/p&gt;

&lt;p&gt;Add the following code to the &lt;code&gt;docker-compose.yml&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;3.3'&lt;/span&gt;

&lt;span class="na"&gt;services&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;db&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;mariadb&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;./mywebsite/db:/var/lib/mysql&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;MYSQL_ROOT_PASSWORD&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;root&lt;/span&gt;
      &lt;span class="na"&gt;MYSQL_DATABASE&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;wordpress_db&lt;/span&gt;
      &lt;span class="na"&gt;MYSQL_PASSWORD&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;root&lt;/span&gt;

  &lt;span class="na"&gt;wordpress&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;context&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;docker&lt;/span&gt;
      &lt;span class="na"&gt;dockerfile&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Dockerfile&lt;/span&gt;
      &lt;span class="na"&gt;args&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;HOST_UID&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${HOST_UID}&lt;/span&gt;
    &lt;span class="na"&gt;depends_on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;db&lt;/span&gt;
    &lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;./mywebsite/wp:/var/www/html&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;wordpress:latest&lt;/span&gt;

    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;80:80"&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;WORDPRESS_DB_HOST&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;db:3306&lt;/span&gt;
      &lt;span class="na"&gt;WORDPRESS_DB_USER&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;root&lt;/span&gt;
      &lt;span class="na"&gt;WORDPRESS_DB_PASSWORD&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;root&lt;/span&gt;
      &lt;span class="na"&gt;WORDPRESS_DB_NAME&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;wordpress_db&lt;/span&gt;

&lt;span class="na"&gt;volumes&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;db_data&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Create Docker file
&lt;/h3&gt;

&lt;p&gt;docker/Dockerfile&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;FROM wordpress:latest&lt;/span&gt;

&lt;span class="s"&gt;ARG HOST_UID=1000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the &lt;code&gt;docker-compose.yml&lt;/code&gt; file and Dockerfile.&lt;/p&gt;

&lt;p&gt;Open a terminal or command prompt and navigate to the directory where you created the &lt;code&gt;docker-compose.yml&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Run the following command to start the WordPress development environment:&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;Docker Compose will download the necessary images and start the containers. Wait for the process to complete.&lt;/p&gt;

&lt;p&gt;Once the containers are up and running, you can access your WordPress site by opening a web browser and going to &lt;code&gt;http://localhost&lt;/code&gt;. You should see the WordPress installation page.&lt;/p&gt;

&lt;p&gt;Follow the on-screen instructions to complete the WordPress installation, including setting up the admin account and database connection.&lt;/p&gt;

&lt;p&gt;You can make changes to the WordPress files in the &lt;code&gt;wp-content&lt;/code&gt; directory of your project. Any changes you make will be reflected in the running containers.&lt;/p&gt;

&lt;p&gt;To stop the development environment, run the following command:&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;This will stop and remove the containers, but your data will persist in the &lt;code&gt;db_data&lt;/code&gt; volume, so you won't lose any changes or content.&lt;/p&gt;

&lt;p&gt;You now have a fully functional WordPress development environment set up with Docker Compose!&lt;br&gt;
Note: Make sure to replace &lt;code&gt;password&lt;/code&gt; with your desired password for the MySQL database and WordPress user. Also, you can change the port &lt;code&gt;8000&lt;/code&gt; in the &lt;code&gt;docker-compose.yml&lt;/code&gt; file to any other available port if you prefer.&lt;/p&gt;

&lt;p&gt;Additionally, if you need to access the MySQL database directly, you can use a tool like phpMyAdmin. To do so, add the following service definition to the &lt;code&gt;docker-compose.yml&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;  &lt;span class="na"&gt;phpadmin&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;depends_on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;db&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;phpmyadmin&lt;/span&gt;
    &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
    &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;8080:80"&lt;/span&gt;
    &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;PMA_HOST&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;db&lt;/span&gt;
      &lt;span class="na"&gt;MYSQL_ROOT_PASSWORD&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;root&lt;/span&gt;
      &lt;span class="na"&gt;UPLOAD_LIMIT&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;300000000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the file and run &lt;code&gt;docker-compose up -d&lt;/code&gt; to start the phpMyAdmin container. You can then access phpMyAdmin by going to &lt;code&gt;http://localhost:8080&lt;/code&gt; in your web browser.&lt;br&gt;
Good luck!&lt;/p&gt;

&lt;p&gt;Contact me to support!&lt;br&gt;
&lt;a href="https://twitter.com/ducmynguyen"&gt;Twitter&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.facebook.com/ducmy.nguyen.vn/"&gt;Facebook&lt;/a&gt;&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>docker</category>
      <category>setupenv</category>
      <category>dev2023</category>
    </item>
  </channel>
</rss>
