Compare commits

..

No commits in common. 'main' and 'podman-compose-env' have entirely different histories.

  1. 4
      .gitignore
  2. 35
      INSTALL.md
  3. 10
      LICENSE.md
  4. 36
      README.md
  5. 3
      ansible/playbooks/equilibrateit.com.yml
  6. 47
      docker-compose.yml
  7. 22
      tofu/main.tf
  8. 44
      tofu/variables.tf

4
.gitignore vendored

@ -1,4 +0,0 @@
archives/
tofu/terraform*
tofu/.terraform*
tofu/.*

@ -1,35 +0,0 @@
- ## Standalone Wordpress Container Docs
- `git clone https://git.libre.audio/EquilibrateIT/ansible_wordpress-standalone.git`
- `cd ansible_wordpress-standalone`
- *Optional* - rename ansible/playbooks/equilibrate.com.yml to match your domain name
- `ansible-playbook ansible/playbooks/yoursite.com.yml`
- `ssh yoursite.com`
- `su - wordpress`
- *Optional*
a. Remove firewall rule for port 80
`firewall-cmd --zone=public --remove-rich-rule rule family="ipv4" forward-port port="80" protocol="tcp" to-port="8080"`
b. Create ssl certificates
`certbot certonly -d yoursite.com`
c. Copy the certificates where the container build will pick them up
`mv /etc/letsencrypt/live/yoursite.com/privkey.pem /home/wordpress/wordpress/apache/`
`mv /etc/letsencrypt/live/yoursite.com/fullchain.pem /home/wordpress/wordpress/apache/`
d. Reload firewall rules to put the port 80 forward rule back in place
`firewall-cmd --reload`
- *Optional*
a. Generate self-signed certificates
`cd ~/wordpress/apache`
`openssl req -x509 -newkey rsa:4096 -keyout privkey.pem -out fullchain.pem -sha256 -days 3650 -nodes -subj "/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=CommonNameOrHostname"`
- Create ~/.env file
```
MYSQL_ROOT_PASSWORD="<YourSecureRootPassword>"
MYSQL_DATABASE=wordpress
MYSQL_USER=wordpress
MYSQL_PASSWORD="<YourSecurePassword>"
WORDPRESS_DB_NAME=wordpress
WORDPRESS_DB_HOST=db:3306
WORDPRESS_DB_USER=wordpress
WORDPRESS_DB_PASSWORD="<YourSecurePassword>"
```
- `cd ~`
`podman-compose up -d`

@ -1,10 +0,0 @@
Copyright 2024 Equilibrate IT Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

@ -1,35 +1 @@
- ## Standalone Wordpress Container Docs
- `git clone https://git.libre.audio/EquilibrateIT/ansible_wordpress-standalone.git`
- `cd ansible_wordpress-standalone`
- *Optional* - rename ansible/playbooks/equilibrate.com.yml to match your domain name
- `ansible-playbook ansible/playbooks/yoursite.com.yml`
- `ssh yoursite.com`
- `su - wordpress`
- *Optional*
a. Remove firewall rule for port 80
`firewall-cmd --zone=public --remove-rich-rule rule family="ipv4" forward-port port="80" protocol="tcp" to-port="8080"`
b. Create ssl certificates
`certbot certonly -d yoursite.com`
c. Copy the certificates where the container build will pick them up
`mv /etc/letsencrypt/live/yoursite.com/privkey.pem /home/wordpress/wordpress/apache/`
`mv /etc/letsencrypt/live/yoursite.com/fullchain.pem /home/wordpress/wordpress/apache/`
d. Reload firewall rules to put the port 80 forward rule back in place
`firewall-cmd --reload`
- *Optional*
a. Generate self-signed certificates
`cd ~/wordpress/apache`
`openssl req -x509 -newkey rsa:4096 -keyout privkey.pem -out fullchain.pem -sha256 -days 3650 -nodes -subj "/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=CommonNameOrHostname"`
- Create ~/.env file
```
MYSQL_ROOT_PASSWORD="<YourSecureRootPassword>"
MYSQL_DATABASE=wordpress
MYSQL_USER=wordpress
MYSQL_PASSWORD="<YourSecurePassword>"
WORDPRESS_DB_NAME=wordpress
WORDPRESS_DB_HOST=db:3306
WORDPRESS_DB_USER=wordpress
WORDPRESS_DB_PASSWORD="<YourSecurePassword>"
```
- `cd ~`
`podman-compose up -d`
A containerized Wordpress, MySQL stack using [this official upstream project Dockerfile](https://github.com/docker-library/wordpress/blob/3f1a0cab9f2f938bbc57f5f92ec11eeea4511636/latest/php8.2/apache/Dockerfile)

@ -5,6 +5,3 @@
roles:
- podman-host
- repo-epel
- certbot
- podman-wordpress

@ -0,0 +1,47 @@
version: '3.6'
services:
db:
image: mysql:5.7
volumes:
- ~/wordpress/database:/var/lib/mysql
restart: always
env_file: ".env"
wordpress:
image: wordpress:latest
volumes:
- ~/wordpress/data:/var/www/html
depends_on:
- db
ports:
- 8080:80 # change to 80:80 when the shop is ready to go live
restart: always
env_file: ".env"
wordpress-cli:
depends_on:
- db
- wordpress
image: wordpress:cli
# vstm: This is required to run wordpress-cli with the same
# user-id as wordpress. This way there are no permission problems
# when running the cli
user: '33'
# vstm: The sleep 10 is required so that the command is run after
# mysql is initialized. Depending on your machine this might take
# longer or it can go faster.
## command: >
## /bin/sh -c '
## sleep 10;
## wp core install --path="/var/www/html" --url="http://localhost:8080" --title="Local Wordpress By Docker" --admin_user=admin --admin_password=supersecretpassword --admin_email=admin@your.site
command: >
/bin/sh -c '
sleep 10;
wp user list'
# vstm: add shared volume
volumes:
- ~/wordpress/data:/var/www/html
# WP CLI needs the environment variables used for the Wordpress image
env_file: ".env"

@ -1,22 +0,0 @@
terraform {
required_providers {
linode = {
source = "linode/linode"
version = "2.26.0"
}
}
}
provider linode {
# Configuration options
token = var.token
}
resource linode_instance "instance" {
label = var.label
image = var.image
region = var.region
type = var.type
authorized_keys = var.authorized_keys
root_pass = var.root_pass
}

@ -1,44 +0,0 @@
## Required Variables
##
variable "token" {
description = "The linode API Token"
type = string
}
variable "label" {
description = "The label for the linode."
type = string
}
variable "root_pass" {
description = "The root password of the linode."
type = string
}
## Optional Variables
##
variable "image" {
description = "The OS image for the linode."
type = string
default = "linode/almalinux9"
}
variable "region" {
description = "The region where the linode will run."
type = string
default = "ca-central"
}
variable "type" {
description = "The linode host type."
type = string
default = "g6-nanode-1"
}
variable "authorized_keys" {
description = "The list of public keys to be authorized for ssh login."
type = list
default = ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeRI1w3uNny7KjK2UdlAnyoGdGgtOx4isSD52u5dr4QkkdLRMj42dLjgT0MK+QehlgaH2XzFPMDz+hZQ+66YeBSm+F4km/8F9XVyUzGl0scUA1p0pqeL3FiyM3Art4Bo71zuE3PvMjyI3pGMKQ3VDWVA0XdAjjSw4G+czJTxZLLBPGvzDT07WuWM4Evl6H21Gn7PB6CKNV0vuUZwGiCsjRbghml1L2kDtTXV1B6wQsniuhQigIVo6YXhMgge/2UCcmiyeEizdfaSstrQHEyxFMvlPUJyw4a3plAuPORDyZdAFF6OA7/wP5fVWoCu/CkbMIDjPifXGQOuhQU1qUVy7r m00t@miserver.lan"]
}
Loading…
Cancel
Save