<?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: Anthony Gilbert</title>
    <description>The latest articles on DEV Community by Anthony Gilbert (@anthony-gilbert).</description>
    <link>https://dev.to/anthony-gilbert</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%2F386996%2F0a7cc4a7-8e8d-4c4e-a131-55097eb723bd.png</url>
      <title>DEV Community: Anthony Gilbert</title>
      <link>https://dev.to/anthony-gilbert</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anthony-gilbert"/>
    <language>en</language>
    <item>
      <title>How to Install and Configure MySQL on Ubuntu</title>
      <dc:creator>Anthony Gilbert</dc:creator>
      <pubDate>Tue, 04 Mar 2025 05:13:16 +0000</pubDate>
      <link>https://dev.to/anthony-gilbert/how-to-install-and-configure-mysql-on-ubuntu-50ip</link>
      <guid>https://dev.to/anthony-gilbert/how-to-install-and-configure-mysql-on-ubuntu-50ip</guid>
      <description>&lt;p&gt;MySQL is one of the most popular relational database management systems. In this post, we’ll walk through a simple process to install and set up MySQL on Ubuntu.&lt;/p&gt;

&lt;p&gt;Step 1: Update Your Package List&lt;br&gt;
Before installing any new packages, update your local package index:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 2: Install MySQL Server&lt;br&gt;
Install MySQL by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;mysql-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command installs the MySQL server package and any required dependencies.&lt;/p&gt;

&lt;p&gt;Step 3: Secure Your MySQL Installation&lt;br&gt;
After installation, run the built-in security script to improve your MySQL configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;mysql_secure_installation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You’ll be prompted to configure settings like:&lt;/p&gt;

&lt;p&gt;Validating password plugins&lt;br&gt;
Setting a strong root password&lt;br&gt;
Removing anonymous users&lt;br&gt;
Disabling remote root login&lt;br&gt;
Removing the test database&lt;br&gt;
Answer the prompts according to your security needs.&lt;/p&gt;

&lt;p&gt;Step 4: Verify MySQL is Running&lt;br&gt;
Check the status of the MySQL service to ensure it’s active:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If MySQL isn’t running, start it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 5: Log Into MySQL&lt;br&gt;
Access the MySQL shell using the root account:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From here, you can execute SQL commands to create databases, users, and manage your database server.&lt;/p&gt;

&lt;p&gt;Step 6: Create a New Database and User (Optional)&lt;br&gt;
For added security and organization, it’s a good idea to create a dedicated database and user rather than using the root account. Here’s an example:&lt;/p&gt;

&lt;p&gt;Create a new database:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="n"&gt;my_database&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a new user and grant privileges:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;USER&lt;/span&gt; &lt;span class="s1"&gt;'myuser'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'localhost'&lt;/span&gt; &lt;span class="n"&gt;IDENTIFIED&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="s1"&gt;'mypassword'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;ALL&lt;/span&gt; &lt;span class="k"&gt;PRIVILEGES&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;my_database&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="s1"&gt;'myuser'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'localhost'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;FLUSH&lt;/span&gt; &lt;span class="k"&gt;PRIVILEGES&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;my_database&lt;/code&gt;, &lt;code&gt;myuser&lt;/code&gt;, and &lt;code&gt;mypassword&lt;/code&gt; with your desired names and secure password.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>React vs Vue - Which should you choose?</title>
      <dc:creator>Anthony Gilbert</dc:creator>
      <pubDate>Tue, 05 Jul 2022 18:43:00 +0000</pubDate>
      <link>https://dev.to/anthony-gilbert/react-vs-vue-which-should-you-choose-26g1</link>
      <guid>https://dev.to/anthony-gilbert/react-vs-vue-which-should-you-choose-26g1</guid>
      <description>&lt;p&gt;Choose Vue.&lt;/p&gt;

</description>
      <category>react</category>
      <category>vue</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Install and config PostgreSQL on Ubuntu Linux</title>
      <dc:creator>Anthony Gilbert</dc:creator>
      <pubDate>Fri, 25 Mar 2022 04:49:12 +0000</pubDate>
      <link>https://dev.to/anthony-gilbert/install-and-config-postgresql-on-ubuntu-linux-4djd</link>
      <guid>https://dev.to/anthony-gilbert/install-and-config-postgresql-on-ubuntu-linux-4djd</guid>
      <description>&lt;p&gt;First we need to install PostgreSQL&lt;br&gt;
&lt;code&gt;sudo apt get install postgresql postgresql-contrib&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now we check the path for PostgreSQL(for me it is version 12, it might be different for you)&lt;br&gt;
&lt;code&gt;ls /etc/postgresql/12/main/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This allows us to check all of the commands available to us&lt;br&gt;
&lt;code&gt;service postgresql&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will allow us to check the status&lt;br&gt;
&lt;code&gt;service postgresql status&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will log us in as the default user&lt;br&gt;
&lt;code&gt;sudo su postgres&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now if we run &lt;code&gt;psql&lt;/code&gt; we will enter the postgresql cli.&lt;/p&gt;

&lt;p&gt;From here, you can run &lt;code&gt;\l&lt;/code&gt; to see the default databases.&lt;/p&gt;

&lt;p&gt;You can also run &lt;code&gt;\du&lt;/code&gt; to list all of the users.&lt;/p&gt;

&lt;p&gt;To change the password of the default user 'postgres', run &lt;code&gt;ALTER USER postgres WITH PASSWORD 'test123';&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To create a new user:&lt;br&gt;
&lt;code&gt;CREATE USER nova_glow WITH PASSWORD 'test123';&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now if we want to give our new user "super" access...&lt;br&gt;
&lt;code&gt;ALTER USER nova_glow WITH SUPERUSER;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If You want to remove a user, simply do the following:&lt;br&gt;
&lt;code&gt;DROP USER user_2;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you want to see all of the available commands for psql, you can simply run &lt;code&gt;man psql&lt;/code&gt; in a new shell.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Note:&lt;/u&gt; It is recommended to install &lt;code&gt;pgadmin&lt;/code&gt; from the software center.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Setting up a Symfony application using Docker.</title>
      <dc:creator>Anthony Gilbert</dc:creator>
      <pubDate>Tue, 14 Dec 2021 08:53:53 +0000</pubDate>
      <link>https://dev.to/anthony-gilbert/setting-up-a-symfony-application-using-docker-4jl3</link>
      <guid>https://dev.to/anthony-gilbert/setting-up-a-symfony-application-using-docker-4jl3</guid>
      <description>&lt;p&gt;In this blog we are going to be setting up a Symfony application inside of a Docker container. If you have not previously worked with a plain Docker file, you can follow my last post &lt;a href="https://www.therelicans.com/anthonygilbertt/setting-up-a-plain-docker-container-then-adding-libraries-part-1-2-54gf" rel="noopener noreferrer"&gt;here.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At this point we should have our container running, and inside of our container we can run the following &lt;a href=""&gt;commands.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To create our own docker container we need to create two new files:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;docker-compose.yml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;nginx.conf&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The &lt;code&gt;docker-compose.yml&lt;/code&gt; should contain the following code&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:
    web:
        image: nginx:latest
        ports:
            - "80:80"
        volumes:
            - ./nginx.conf:/etc/nginx/conf.d/nginx.conf
            - ./app:/app
    php:
        image: php:fpm
        volumes:
            - ./app:/app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In order for this to work, you need to create an 'app' folder and inside of that, you need to create a 'public' folder, inside of that you can create your &lt;code&gt;index.html&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;As for the 2nd file mentioned, you need to add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server {
    listen 80 default_server;
    root /app/public;
} 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will start the container server and tell the container which directory to point to. &lt;br&gt;
Once we have done this we need to create a &lt;code&gt;index.php&lt;/code&gt; file inside of the &lt;code&gt;/app/public&lt;/code&gt; directory.&lt;/p&gt;

&lt;p&gt;Inside of our newly created &lt;code&gt;index.php&lt;/code&gt; file, we need to copy/paste the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
phpinfo();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we need to re-run the server using &lt;code&gt;docker-compose up&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After restarting the docker container we should see PHP manual page.&lt;br&gt;
If you see this, then congratulations, you have successfully created your PHP Docker container!! 🎊 🎊&lt;/p&gt;

&lt;p&gt;Now that we have our basic PHP container, we can add Symfony to it.&lt;/p&gt;

&lt;p&gt;To do this we need to stop the server by using the &lt;code&gt;control&lt;/code&gt; + &lt;code&gt;c&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;Afterwards we want to run the following command: &lt;code&gt;curl -LO https://raw.githubusercontent.com/bitnami/bitnami-docker-symfony/master/docker-compose.yml&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will download Bitnami's official Symfony &lt;code&gt;docker-compose.yml&lt;/code&gt; image. Once this command has finished, we can re-run &lt;code&gt;docker-compose up&lt;/code&gt; to run the build process. This is going to take some time, so feel free to grab a beverage.&lt;/p&gt;

&lt;p&gt;Once it has finished, you can visit &lt;code&gt;localhost:8000&lt;/code&gt; to visit your newly generated Symfony app.  Which should look like this &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffbrlj7z6t53g9x3b5qx6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffbrlj7z6t53g9x3b5qx6.png" alt="A picture of the complete product." width="360" height="242"&gt;&lt;/a&gt;&lt;br&gt;
And you're done!!  &lt;/p&gt;

&lt;p&gt;-Anthony&lt;br&gt;
Follow me on &lt;a href="https://twitter.com/anthony_codes" rel="noopener noreferrer"&gt;twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>docker</category>
    </item>
    <item>
      <title>Setting up apache with Docker for frontend development.</title>
      <dc:creator>Anthony Gilbert</dc:creator>
      <pubDate>Tue, 14 Dec 2021 08:52:32 +0000</pubDate>
      <link>https://dev.to/anthony-gilbert/setting-up-apache-with-docker-for-frontend-development-37kb</link>
      <guid>https://dev.to/anthony-gilbert/setting-up-apache-with-docker-for-frontend-development-37kb</guid>
      <description>&lt;p&gt;In this part, we are going to be setting up a plain Docker container(just HTML).&lt;/p&gt;

&lt;p&gt;To get started, the first thing we want to do is install Docker.  You can do this by downloading it from the &lt;a href="https://www.docker.com/get-started" rel="noopener noreferrer"&gt;Docker website.&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To get started we will create an empty directory by typing &lt;code&gt;mkdir &amp;lt;project-name&amp;gt;&lt;/code&gt; and then &lt;code&gt;cd&lt;/code&gt; into that directory.&lt;/p&gt;

&lt;p&gt;Once we have cd' into our new directory, we will create a new Docker file by typing &lt;code&gt;touch Dockerfile&lt;/code&gt; into the terminal.  Once the file is created you can open it with your favorite editor and paste the following &lt;a href="https://carbon.now.sh/?bg=rgba%2826%2C50%2C75%2C1%29&amp;amp;t=night-owl&amp;amp;wt=none&amp;amp;l=dockerfile&amp;amp;ds=true&amp;amp;dsyoff=20px&amp;amp;dsblur=68px&amp;amp;wc=true&amp;amp;wa=true&amp;amp;pv=56px&amp;amp;ph=56px&amp;amp;ln=false&amp;amp;fl=1&amp;amp;fm=Hack&amp;amp;fs=14px&amp;amp;lh=133%25&amp;amp;si=false&amp;amp;es=2x&amp;amp;wm=false&amp;amp;code=FROM%2520ubuntu%253A18.04%250AMAINTAINER%2520Faithful%2520%253Cfaithful%2540infused.io%253E%250ARUN%2520apt-get%2520update%2520%2526%2526%2520apt-get%2520install%2520-y%2520apache2%2520%2526%2526%2520apt-get%2520clean%2520%2526%2526%2520rm%2520-rf%2520%252Fvar%252Flib%252Fapt%252Flists%252F*%250AENV%2520APACHE_RUN_USER%2520%2520www-data%250AENV%2520APACHE_RUN_GROUP%2520www-data%250AENV%2520APACHE_LOG_DIR%2520%2520%2520%252Fvar%252Flog%252Fapache2%250AENV%2520APACHE_PID_FILE%2520%2520%252Fvar%252Frun%252Fapache2%252Fapache2.pid%250AENV%2520APACHE_RUN_DIR%2520%2520%2520%252Fvar%252Frun%252Fapache2%250AENV%2520APACHE_LOCK_DIR%2520%2520%252Fvar%252Flock%252Fapache2%250AENV%2520APACHE_LOG_DIR%2520%2520%2520%252Fvar%252Flog%252Fapache2%250ARUN%2520mkdir%2520-p%2520%2524APACHE_RUN_DIR%250ARUN%2520mkdir%2520-p%2520%2524APACHE_LOCK_DIR%250ARUN%2520mkdir%2520-p%2520%2524APACHE_LOG_DIR%250ACOPY%2520index.html%2520%252Fvar%252Fwww%252Fhtml%250AEXPOSE%252080%250ACMD%2520%255B%2522%252Fusr%252Fsbin%252Fapache2%2522%252C%2520%2522-D%2522%252C%2520%2522FOREGROUND%2522%255D" rel="noopener noreferrer"&gt;code&lt;/a&gt; inside of it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; ubuntu:18.04&lt;/span&gt;
&lt;span class="k"&gt;MAINTAINER&lt;/span&gt;&lt;span class="s"&gt; Faithful &amp;lt;faithful@infused.io&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;apt-get update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; apache2 &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get clean &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; /var/lib/apt/lists/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;ENV&lt;/span&gt;&lt;span class="s"&gt; APACHE_RUN_USER  www-data&lt;/span&gt;
&lt;span class="k"&gt;ENV&lt;/span&gt;&lt;span class="s"&gt; APACHE_RUN_GROUP www-data&lt;/span&gt;
&lt;span class="k"&gt;ENV&lt;/span&gt;&lt;span class="s"&gt; APACHE_LOG_DIR   /var/log/apache2&lt;/span&gt;
&lt;span class="k"&gt;ENV&lt;/span&gt;&lt;span class="s"&gt; APACHE_PID_FILE  /var/run/apache2/apache2.pid&lt;/span&gt;
&lt;span class="k"&gt;ENV&lt;/span&gt;&lt;span class="s"&gt; APACHE_RUN_DIR   /var/run/apache2&lt;/span&gt;
&lt;span class="k"&gt;ENV&lt;/span&gt;&lt;span class="s"&gt; APACHE_LOCK_DIR  /var/lock/apache2&lt;/span&gt;
&lt;span class="k"&gt;ENV&lt;/span&gt;&lt;span class="s"&gt; APACHE_LOG_DIR   /var/log/apache2&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="nv"&gt;$APACHE_RUN_DIR&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="nv"&gt;$APACHE_LOCK_DIR&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="nv"&gt;$APACHE_LOG_DIR&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; index.html /var/www/html&lt;/span&gt;
&lt;span class="k"&gt;EXPOSE&lt;/span&gt;&lt;span class="s"&gt; 80&lt;/span&gt;
&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; ["/usr/sbin/apache2", "-D", "FOREGROUND"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you have done this, we need to run &lt;code&gt;touch index.html&lt;/code&gt; and then copy/paste the following &lt;a href="https://carbon.now.sh/?bg=rgba%2826%2C50%2C75%2C1%29&amp;amp;t=night-owl&amp;amp;wt=none&amp;amp;l=htmlmixed&amp;amp;ds=true&amp;amp;dsyoff=20px&amp;amp;dsblur=68px&amp;amp;wc=true&amp;amp;wa=true&amp;amp;pv=56px&amp;amp;ph=56px&amp;amp;ln=false&amp;amp;fl=1&amp;amp;fm=Hack&amp;amp;fs=14px&amp;amp;lh=133%25&amp;amp;si=false&amp;amp;es=2x&amp;amp;wm=false&amp;amp;code=%253C%21DOCTYPE%2520html%253E%250A%253Chtml%2520lang%253D%2522en%2522%253E%250A%253Chead%253E%250A%2520%2520%2520%2520%253Cmeta%2520charset%253D%2522UTF-8%2522%253E%250A%2520%2520%2520%2520%253Ctitle%253EFirst%2520APP%253C%252Ftitle%253E%250A%253C%252Fhead%253E%250A%253Cbody%253E%250A%2520%2520%2520%2520%253Ch1%253EHello%2520from%2520Docker%21%253C%252Fh1%253E%250A%253C%252Fbody%253E%250A%253C%252Fhtml%253E" rel="noopener noreferrer"&gt;code&lt;/a&gt; into our newly created html file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;First APP&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Hello from Docker!&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that we have configured a basic Dockerfile, we need to build the image by typing &lt;code&gt;docker build -t &amp;lt;project-name&amp;gt; .&lt;/code&gt; into the terminal afterwards you should see your new image in the output.&lt;/p&gt;

&lt;p&gt;Once the command has finished, we should now have a new image. You can double check this by typing &lt;code&gt;docker images&lt;/code&gt; into the terminal.&lt;/p&gt;

&lt;p&gt;Now to run our new image we need to type the following: &lt;code&gt;docker run -d -p 80:80 &amp;lt;project name&amp;gt;&lt;/code&gt;. You will know that the image has been built successfully when it return a unique identifier.&lt;/p&gt;

&lt;p&gt;Congratulations! 🥳&lt;br&gt;
You have successfully created a Docker container with just an HTML file!!  From here you can add your own libraries. &lt;/p&gt;

&lt;p&gt;To visit the newly created UI, go to &lt;code&gt;http://localhost/index.html&lt;/code&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>docker</category>
      <category>apache</category>
    </item>
    <item>
      <title>How to set up Symfony &amp; then Dockerize it.</title>
      <dc:creator>Anthony Gilbert</dc:creator>
      <pubDate>Tue, 14 Dec 2021 08:48:01 +0000</pubDate>
      <link>https://dev.to/anthony-gilbert/how-to-set-up-symfony-then-dockerize-it-59k1</link>
      <guid>https://dev.to/anthony-gilbert/how-to-set-up-symfony-then-dockerize-it-59k1</guid>
      <description>&lt;p&gt;In this post we are going to be setting up a Symfony Docker environment.  If you don't know what Symfony is, it's a PHP framework.&lt;/p&gt;

&lt;p&gt;To get started we will install PHP, in this example we will be using PHP version 7.3.  To do this you can install by typing the following:&lt;br&gt;
&lt;code&gt;brew install php&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After install PHP we need to install composer, which is the PHP package manager. To do this we can copy-paste the following into the terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="s2"&gt;"copy('https://getcomposer.org/installer', 'composer-setup.php');"&lt;/span&gt;
php &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="s2"&gt;"if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"&lt;/span&gt;
php composer-setup.php
php &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="s2"&gt;"unlink('composer-setup.php');"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can run the following command to check if your system meets the Symfony requirements. &lt;code&gt;symfony check:requirements&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To create our Symfony project we will run the following command. &lt;code&gt;symfony new my_project_name --full&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now to start our web server, we will run this command. &lt;code&gt;symfony server:start&lt;/code&gt;, now your web server should be running on default port, 8000.&lt;/p&gt;

&lt;p&gt;Now that we have our default application built, we need to install Docker. To do this you can run the following command in your terminal: &lt;code&gt;brew install docker&lt;/code&gt; or visit the Docker website and download the executable.&lt;/p&gt;

&lt;p&gt;Now we need to add a Dockerfile to the root of our project. You can do this by typing &lt;code&gt;touch Dockerfile&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After creating your Dockerfile you will need to paste the following code into your Dockerfile. &lt;a href="https://dockerize.io/guides/docker-symfony-guide#makethedockerappimage" rel="noopener noreferrer"&gt;Code&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="c"&gt;# Dockerfile&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; php:7.2-cli&lt;/span&gt;

&lt;span class="k"&gt;RUN &lt;/span&gt;apt-get update &lt;span class="nt"&gt;-y&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; libmcrypt-dev

&lt;span class="k"&gt;RUN &lt;/span&gt;curl &lt;span class="nt"&gt;-sS&lt;/span&gt; https://getcomposer.org/installer | php &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nt"&gt;--install-dir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/usr/local/bin &lt;span class="nt"&gt;--filename&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;composer
&lt;span class="k"&gt;RUN &lt;/span&gt;docker-php-ext-install pdo mbstring

&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /app&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; . /app&lt;/span&gt;

&lt;span class="k"&gt;RUN &lt;/span&gt;composer &lt;span class="nb"&gt;install&lt;/span&gt;

&lt;span class="k"&gt;EXPOSE&lt;/span&gt;&lt;span class="s"&gt; 8000&lt;/span&gt;
&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; php bin/console server:run 0.0.0.0:8000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To build our php Symfony docker container, we will use the &lt;code&gt;docker build&lt;/code&gt; command and provide a tag or a name for the container, so we can reference it later when we want to run it. The final part of the command tells Docker which directory to build from.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;docker build -t symfony-tutorial .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After running the build command, you need to create the image. To do this you need to type the following: &lt;code&gt;docker build -t symfony-tutorial .&lt;/code&gt;  You can make sure that the image has been created by typing &lt;code&gt;docker images&lt;/code&gt; into the terminal.&lt;/p&gt;

&lt;p&gt;Now that the docker image has been created, you can run your docker image and upon doing so, it will start the web server.&lt;br&gt;
Here is how you do it: &lt;code&gt;docker build -t symfony-tutorial .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now your docker environment is running on port &lt;code&gt;8000&lt;/code&gt;!!&lt;/p&gt;

&lt;p&gt;Happy coding!!&lt;/p&gt;

&lt;p&gt;-Anthony&lt;/p&gt;

</description>
      <category>docker</category>
      <category>php</category>
      <category>symfony</category>
    </item>
  </channel>
</rss>
