Compare commits

..

43 Commits

Author SHA1 Message Date
Mike Holloway
f645db0c6b License 2024-09-05 21:28:39 -04:00
Mike Holloway
2c16a9384d INSTALL.md Update 2024-08-22 22:45:47 -04:00
Mike Holloway
fce70ffafc INSTALL.md Update 2024-08-22 22:44:14 -04:00
Mike Holloway
06b7137a8e INSTALL.md Update 2024-08-22 22:43:22 -04:00
Mike Holloway
10f3de4def README.md Update 2024-08-22 22:33:27 -04:00
Mike Holloway
1e5e0226c5 README.md Update 2024-08-22 22:31:42 -04:00
Mike Holloway
66754dcdeb README.md Update 2024-08-22 22:29:29 -04:00
Mike Holloway
ee3cebc340 Basic INSTALL.md 2024-08-22 22:26:47 -04:00
Mike Holloway
bb245a6e4f tofu file noes 2024-08-22 19:17:56 -04:00
Mike Holloway
9ca42ee4cd Cleaned up README.md 2024-08-22 19:15:29 -04:00
Mike Holloway
e82e9ff831 Change default host back to equilibrateit.com 2024-08-22 19:11:03 -04:00
Mike Holloway
b3bffb22c0 podman-wordpress role created
modified:   ../.gitignore
	Added env files
modified:   ../ansible/playbooks/equilibrateit.com.yml
	Moved tasks to role
deleted:    ../docker-compose.yml
	Moved file to role
new file:   main.tf
	Tofu provider
new file:   variables.tf
	Tofu resource variables
deleted:    ../wordpress/apache/Dockerfile
	Changed file to template, moved to role
2024-08-22 19:03:07 -04:00
Mike Holloway
1111c1a203 Hostname change. 2024-08-21 09:42:26 -04:00
Mike Holloway
1692a85c81 README.md - Step explanation update. 2024-08-21 08:39:09 -04:00
Mike Holloway
646e24d465 Adding firewall port forward tasks 2024-08-21 07:16:26 -04:00
Mike Holloway
8c7af4bde8 New ToDos 2024-08-21 06:18:19 -04:00
Mike Holloway
cdf8fc723b Add gitignore - archives folder 2024-08-20 17:49:51 -04:00
Mike Holloway
981f252c3d Add ssl port 2024-08-19 17:36:57 -04:00
Mike Holloway
c2cfd65461 README.md To Dos 2024-08-19 17:29:18 -04:00
Mike Holloway
5e2b9fbd25 SSL config adjustments/ 2024-08-19 17:25:43 -04:00
Mike Holloway
cc854e6f3a COPY Path Work 2024-08-19 17:21:18 -04:00
Mike Holloway
9f2d4f3a72 Dockerfile formatting fix 2024-08-19 17:17:49 -04:00
Mike Holloway
263428372f Enable apache2 mod_ssl 2024-08-19 17:15:49 -04:00
Mike Holloway
4f50badec8 Closing VirtualHost config block 2024-08-19 17:13:21 -04:00
Mike Holloway
a96c3f6e65 sites-avaialbe conf link. 2024-08-19 17:10:20 -04:00
Mike Holloway
d3d0abdfdc Manually copying ssl files to build root 2024-08-19 17:07:44 -04:00
Mike Holloway
ae2f62bf7c Add epel repo role 2024-08-19 16:49:23 -04:00
Mike Holloway
79a38f31e0 modified: ansible/playbooks/equilibrateit.com.yml
Added certbot role
2024-08-19 16:45:47 -04:00
Mike Holloway
396b4af76f modified: docker-compose.yml
Added Dockerfile build steps
new file:   wordpress/apache/Dockerfile
	Dockerfile with ssl options
2024-08-19 16:41:36 -04:00
Mike Holloway
119aedff9b Reorder containers 2024-08-19 16:00:53 -04:00
Mike Holloway
36c4306906 README.md updates 2024-08-18 00:14:16 -04:00
Mike Holloway
000f18f3f3 README.md updates 2024-08-18 00:01:30 -04:00
Mike Holloway
207981f430 README.md updates 2024-08-18 00:01:10 -04:00
Mike Holloway
23ee69dd77 README.md updates 2024-08-18 00:00:37 -04:00
Mike Holloway
3b38fcfad8 README.md updates 2024-08-17 23:59:22 -04:00
Mike Holloway
5ae19362a6 README.md updates 2024-08-17 23:58:15 -04:00
Mike Holloway
7f6c41bbfb wordpress-cli initialization cleanup 2024-08-17 19:43:01 -04:00
Mike Holloway
d6708eb20b Formatting changes 2024-08-17 19:17:56 -04:00
Mike Holloway
dccccc747a Formatting changes 2024-08-17 19:11:42 -04:00
Mike Holloway
1e093bce98 Formatting changes 2024-08-17 19:06:55 -04:00
Mike Holloway
d4e4f75007 Formatting changes 2024-08-17 19:03:43 -04:00
Mike Holloway
e0c0f3e58f Add env_file to mysql container def. 2024-08-17 18:50:23 -04:00
Mike Holloway
2fa7a8a293 Add env_file to mysql container def. 2024-08-17 18:49:03 -04:00
8 changed files with 153 additions and 63 deletions

4
.gitignore vendored Normal file
View File

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

35
INSTALL.md Normal file
View File

@ -0,0 +1,35 @@
- ## 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`

10
LICENSE.md Normal file
View File

@ -0,0 +1,10 @@
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.

View File

@ -1 +1,35 @@
A containerized Wordpress, MySQL stack using [this official upstream project Dockerfile](https://github.com/docker-library/wordpress/blob/3f1a0cab9f2f938bbc57f5f92ec11eeea4511636/latest/php8.2/apache/Dockerfile)
- ## 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`

View File

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

View File

@ -1,62 +0,0 @@
version: '3.6'
services:
db:
image: mysql:5.7
volumes:
- ~/wordpress/database:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: $(MYSQL_ROOT_PASSWORD)
MYSQL_DATABASE: $(MYSQL_DATABASE)
MYSQL_USER: $(MYSQL_USER)
MYSQL_PASSWORD: $(MYSQL_PASSWORD)
wordpress:
image: wordpress:latest
depends_on:
- db
ports:
- 8080:80 # change to 80:80 when the shop is ready to go live
restart: always
env_file: ".env"
environment:
WORDPRESS_DB_NAME: ${WORDPRESS_DB_NAME}
WORDPRESS_DB_HOST: ${WORDPRESS_DB_HOST}
WORDPRESS_DB_USER: ${WORDPRESS_DB_USER}
WORDPRESS_DB_PASSWORD: ${WORDPRESS_DB_PASSWORD}
volumes:
- ~/wordpress/data:/var/www/html
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"
environment:
WORDPRESS_DB_NAME: ${WORDPRESS_DB_NAME}
WORDPRESS_DB_HOST: ${WORDPRESS_DB_HOST}
WORDPRESS_DB_USER: ${WORDPRESS_DB_USER}
WORDPRESS_DB_PASSWORD: ${WORDPRESS_DB_PASSWORD}

22
tofu/main.tf Normal file
View File

@ -0,0 +1,22 @@
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
}

44
tofu/variables.tf Normal file
View File

@ -0,0 +1,44 @@
## 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"]
}