<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>docker-compose &#8211; Webmago Dev</title>
	<atom:link href="https://webmago.dev/tag/docker-compose/feed/" rel="self" type="application/rss+xml" />
	<link>https://webmago.dev</link>
	<description>Creando codigo desde 1990</description>
	<lastBuildDate>Tue, 04 May 2021 13:53:49 +0000</lastBuildDate>
	<language>es</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>WinterCMS, Testing Docker Image</title>
		<link>https://webmago.dev/wintercms-testing-docker-image/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wintercms-testing-docker-image</link>
		
		<dc:creator><![CDATA[webmago]]></dc:creator>
		<pubDate>Tue, 04 May 2021 04:25:15 +0000</pubDate>
				<category><![CDATA[docker]]></category>
		<category><![CDATA[wintercms]]></category>
		<category><![CDATA[docker-compose]]></category>
		<guid isPermaLink="false">https://webmago.dev/?p=1206</guid>
					<description><![CDATA[Some days ago, I created the WinterCMS Docker image for use with PHP 7.2 &#8211; 7.4 on Apache2 or FPM variants; those images/versions are publicly available, is my donation to the OpenSource and WinterCMS communities. Today I put my hands to write a basic docker-compose.yml to test the Docker Image using Docker Compose, SQLite as [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Some days ago, I created the <a title="WinterCMS, descarga la imagen Docker." href="https://webmago.dev/wintercms-descarga-la-imagen-docker/" target="_blank" rel="noopener">WinterCMS Docker image</a> for use with PHP 7.2 &#8211; 7.4 on Apache2 or FPM variants; those images/versions are publicly available, is my donation to the OpenSource and <a title="WinterCMS, descarga la imagen Docker." href="https://wintercms.com" target="_blank" rel="noopener">WinterCMS</a> communities.</p>
<p>Today I put my hands to write a basic <code>docker-compose.yml</code> to test the Docker Image using Docker Compose, SQLite as a database.</p>
<p>I decided to bind to my SSD local directories with <code>storage, themes, plugins, and database</code> container directories to keep this data safe if the container crashes or is removed.</p>
<div id="attachment_1211" style="width: 770px" class="wp-caption aligncenter"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-1211" class="size-full wp-image-1211" src="https://webmago.dev/buvytsan/2021/05/WinterCMS-bind-dirs.png" alt="WinterCMS binding directories" width="760" height="352" srcset="https://webmago.dev/buvytsan/2021/05/WinterCMS-bind-dirs.png 760w, https://webmago.dev/buvytsan/2021/05/WinterCMS-bind-dirs-300x139.png 300w" sizes="(max-width: 760px) 100vw, 760px" /><p id="caption-attachment-1211" class="wp-caption-text">WinterCMS binding directories</p></div>
<p>I created an <code>.env</code> file to inject environment variables and some values into the <code>docker-compose.yml</code> services file.</p>
<pre><code class="language-bash">###
#
# Winter CMS Test Image
# Version 1.0
# @author: WebMago
#
###
#### ---- * WinterCMS Configuration * ---- ####
# Name
CONTAINER_CMS_NAME=wintercms
# Image
CONTAINER_CMS_IMAGE=webmago/winter:stable-v1.1.3-php7.4-apache
# Env values
APP_DEBUG=false
APP_KEY=base64:PUT-YOUR-KEY-HERE
TZ=America/Mexico_City
APP_LOCALE=en
DB_PATH_SQLITE=storage/database.sqlite
DB_TYPE=sqlite
SESSION_DRIVER=file
CMS_ACTIVE_THEME=jacoweb-freelance
#### ---- * WinterCMS Domains * ---- ####
# A fake domain to test locally
WINTER_DOMAINS=winter.webmago.io</code></pre>
<p>&nbsp;</p>
<p>On the <code>docker-compose.yml</code> the <code>.env</code> values are injected as you can view on the code below and the directories are bound locally on my SSD.</p>
<pre><code class="language-yaml">version: &#039;3&#039;
services:
  web-wintercms:
    image: ${CONTAINER_CMS_IMAGE}
    container_name: ${CONTAINER_CMS_NAME}
    restart: unless-stopped
    ports:
      - &quot;80:80&quot;
    environment:
        VIRTUAL_HOST: ${WINTER_DOMAINS}
        APP_DEBUG: ${APP_DEBUG}
        APP_KEY: ${APP_KEY}
        TZ: ${TZ}
        APP_LOCALE: ${APP_LOCALE}
        DB_PATH_SQLITE: ${DB_PATH_SQLITE}
        DB_TYPE: ${DB_TYPE}
        SESSION_DRIVER: ${SESSION_DRIVER}
        CMS_ACTIVE_THEME: ${CMS_ACTIVE_THEME}
    volumes:
     - ./config/test:/var/www/html/config/docker
     - ./wintercms/storage/database.sqlite:/var/www/html/storage/database.sqlite
     - ./wintercms/storage/logs:/var/www/html/storage/logs
     - ./wintercms/storage/app:/var/www/html/storage/app
     - ./wintercms/storage/cms:/var/www/html/storage/cms
     - ./wintercms/themes:/var/www/html/themes
     - ./wintercms/plugins:/var/www/html/plugins
</code></pre>
<p>&nbsp;</p>
<p>To launch WinterCMS execute:</p>
<pre><code class="language-bash">docker-compose up -d</code></pre>
<p>This runs the process in the background, to stop the execution run:</p>
<pre><code class="language-bash">docker-compose down</code></pre>
<p>&nbsp;</p>
<p>The first run creates the <code>database.sqlite</code> and assign a random password to the <code>admin</code> user, this is not visible if you run the <code>docker-compose</code> command using the flag <code>-d</code>.</p>
<p>This can be solved using three scenarios.</p>
<p>&nbsp;</p>
<p><strong>First Scenario</strong></p>
<p>Execute the docker-compose without the flag -d</p>
<p><code class="language-bash">docker-compose up</code></p>
<p>&nbsp;</p>
<p><strong>Second Scenario</strong></p>
<p>If you have been executed the docker-compose with the flag -d and used the YAML of this example, the database is not deleted and the change will keep on the next execution.</p>
<pre><code class="language-bash"># Access the container
docker-compose exec -it wintercms bash
# change the admin password
php artisan winter:passwd
# Enter the username to reset, on this case is admin
 Username to reset:
 &gt; admin
 Enter new password (leave blank for generated password) []:
 &gt; 
Password successfully changed.
# exit the container.
exit</code></pre>
<p>If you require to use <code>redis</code> my advice is to use my images as a base to generate a new image with this PHP extension.</p>
<p>&nbsp;</p>
<p><strong>Third Scenario</strong></p>
<p>Add the environment variable <code>INIT_WINTER</code> with the <code>false</code> value into the <code>environment</code> section of the YAML file, only if you have not executed the <code>docker-compose</code> command as the first run.</p>
<pre><code class="language-bash"># Access the container
docker-compose exec -it wintercms bash
# Winter up
php artisan winter:up
.
. # this show the DB migration process
.
.
. # finally the process displays the random password assigned, this is an example only
- The following password has been automatically generated for the &quot;admin&quot; account: xZ4DF20k8txIrcBRqEhkjw
 </code></pre>
<p><strong>Accessing the Backend</strong> After all the previous process, now you can access the Backend  CMS, on my case I define the host <code>wintercms.webmago.io</code> as a fake URL added to my hosts, on my web browser typed: <code>http://wintercms.webmago.io/backend/</code> the user is <code>admin</code> and my password the defined or adjusted based on the previous three scenarios described. <code>/etc/hosts file</code></p>
<pre><code class="language-bash">127.0.0.1 wintercms.webmago.io</code></pre>
<p>&nbsp;</p>
<div id="attachment_1216" style="width: 1034px" class="wp-caption aligncenter"><img decoding="async" aria-describedby="caption-attachment-1216" class="size-large wp-image-1216" src="https://webmago.dev/buvytsan/2021/05/WinterCMS-sqlite-one-them-1024x378.png" alt="WinterCMS SQLite, Freelance Theme" width="1024" height="378" srcset="https://webmago.dev/buvytsan/2021/05/WinterCMS-sqlite-one-them-1024x378.png 1024w, https://webmago.dev/buvytsan/2021/05/WinterCMS-sqlite-one-them-300x111.png 300w, https://webmago.dev/buvytsan/2021/05/WinterCMS-sqlite-one-them-768x283.png 768w, https://webmago.dev/buvytsan/2021/05/WinterCMS-sqlite-one-them-1536x566.png 1536w, https://webmago.dev/buvytsan/2021/05/WinterCMS-sqlite-one-them-2048x755.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /><p id="caption-attachment-1216" class="wp-caption-text">WinterCMS SQLite, Freelance Theme</p></div>
<p><strong>Glitches</strong></p>
<p>The <code>demo</code> theme currently is not available, this can origin errors on the Frontend, you need to install and activate one of the suggested on the <code>Front-end theme</code> section, find or add your old theme with the required adjustments for WinterCMS.</p>
<p>&nbsp;</p>
<p>On the Plugins section, the oldest OctoberCMS Plugins are available to be installed, this can be an additional article for the WinterCMS series.</p>
<div id="attachment_1217" style="width: 1034px" class="wp-caption aligncenter"><img decoding="async" aria-describedby="caption-attachment-1217" class="size-large wp-image-1217" src="https://webmago.dev/buvytsan/2021/05/WinterCMS-Plugins-1024x562.png" alt="WinterCMS Plugins" width="1024" height="562" srcset="https://webmago.dev/buvytsan/2021/05/WinterCMS-Plugins-1024x562.png 1024w, https://webmago.dev/buvytsan/2021/05/WinterCMS-Plugins-300x165.png 300w, https://webmago.dev/buvytsan/2021/05/WinterCMS-Plugins-768x421.png 768w, https://webmago.dev/buvytsan/2021/05/WinterCMS-Plugins-1536x842.png 1536w, https://webmago.dev/buvytsan/2021/05/WinterCMS-Plugins-2048x1123.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /><p id="caption-attachment-1217" class="wp-caption-text">WinterCMS Plugins</p></div>
<p>&nbsp;</p>
<p>If you require my help, please let me know, <a href="https://webmago.dev/#contact" target="_blank" rel="noopener">contact me</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
