Week 3 ‐ 03.03.2025 ‐ 09.03.2025 - Campus-Castolo/m300 GitHub Wiki
Week 3 - 03.03.2025 ‐ 09.03.2025
Week 3 - 03.03.2025 ‐ 09.03.2025 - Task list
Task | Description | Notes | Status | Start Date | Completion Date | Hours Needed |
---|---|---|---|---|---|---|
Setup VPC in AWS | Create a Virtual Private Cloud for project infrastructure | Define subnets | ✅ | 26.02.2025 | 03.03.2025 | 0.5 hrs |
Research workflow integration | research automation and CI/CD workflows | no notes | ✅ | 26.02.2025 | 04.03.2025 | 3 hrs |
Research Terraform GitHub → ECR | Explore Terraform configurations for automating ECR setup | no notes | ✅ | 26.02.2025 | 04.03.2025 | 2 hrs |
Make custom WordPress Dockerfile | Create custom WordPress Dockerfile, for push to ECR | Create Dockerfile with additional funciton like setup script for automatic startup of plugins | ✅ | 05.03.2025 | 06.03.2025 | 5 hrs |
Recap docker | revise basics of docker-compose and dockerfile | Play around with test wordpress docker compose | ✅ | 05.03.2025 | 05.03.2025 | 2 hrs |
Demo workflow pushing simple Hello World image into AWS ECR | Implement a basic workflow for container image deployment | Validate successful push to AWS ECR | ❌ | --- | --- | --- |
Demo "Hello World Image" to ECS task accessible via public subnet | Deploy and test a containerized app on ECS | Ensure public accessibility | ❌ | --- | --- | --- |
Daily Log 03.03.2025
The daily activities of monday 03.03.2025
Daily Log 03.03.2025 - Activity
Task | Description | Notes | Status | Start Date | Completion Date | Hours Needed |
---|---|---|---|---|---|---|
Setup VPC in AWS | Create a Virtual Private Cloud for project infrastructure | Define subnets | ✅ | 26.02.2025 | 03.03.2025 | 0.5 hrs |
Research workflow integration | research automation and CI/CD workflows | Identify best practices for seamless integration | 💡 | 26.02.2025 | --- | --- |
Research Terraform GitHub → ECR | Explore Terraform configurations for automating ECR setup | Understand security and IAM role requirements | 💡 | 26.02.2025 | --- | --- |
Daily Log 03.03.2025 - Summary
Created a VPC today with the following specifications:
- Name: m300
- IPv4 CIDR block: 10.0.0.0/16
- Nr. of availibility zones: 2
- availability zone 1: us-east 1a
- availability zone 2: us-east 1b
- Nr. of private subnets per avaiability zone: 1
- Nr. of public subnets per availability zone: 1
- NAT-Gateway: 0
- VPC endpoints: 1 S3 Gateway
- DNS Options: Enabled DNS Hostnames, Enabled DNS Resolution
Daily Log 03.03.2025 - Daily Results
Daily Log 03.03.2025 - Problems
No problems occured simply less time as assumed as well I was a bit distracted today, so doing work was very difficult
Daily Log 03.03.2025 - Used Resources
None needed
Daily Log 03.03.2025 - Exercise
Create VPC
Daily Log 04.03.2025
Daily Log 04.03.2025 - Activity
Task | Description | Notes | Status | Start Date | Completion Date | Hours Needed |
---|---|---|---|---|---|---|
Research workflow integration | research automation and CI/CD workflows | no notes | ✅ | 26.02.2025 | 04.03.2025 | 3 hrs |
Research Terraform GitHub → ECR | Explore Terraform configurations for automating ECR setup | no notes | ✅ | 26.02.2025 | 04.03.2025 | 2 hrs |
Daily Log 04.03.2025 - Summary
Today I have spent the bulk of my time researching how to even use Terraform, for me its difficult since its my first time using or even encountering Terraform so I watched alot of videos on Terraform learning — What is Terraform, what is it used for and how does it work in conjuction with AWS. Also did research into GitHub Workflows and experimenting with creating a few workflows these workflows are displayed are documented on the WikiPage.
Daily Log 04.03.2025 - Daily Results
Daily Log 04.03.2025 - Problems
Daily Log 04.03.2025 - Used Resources
Daily Log 04.03.2025 - Exercise
Try out a GitHub Workflow of publishing a HTML-site onto GitHub pages, this is however independent of the Workflows documented.
Daily Log 05.03.2025
Daily Log 05.03.2025 - Activity
Task | Description | Notes | Status | Start Date | Completion Date | Hours Needed |
---|---|---|---|---|---|---|
Recap docker | revise basics of docker-compose and dockerfile | Play around with test wordpress docker compose | ✅ | 05.03.2025 | 05.03.2025 | 2 hrs |
Make custom WordPress Dockerfile | Create custom WordPress Dockerfile, for push to ECR | Create Dockerfile with additional funciton like setup script for automatic startup of plugins | 🛠️ | 05.03.2025 | --- | --- |
Daily Log 05.03.2025 - Summary
I have played around a bit with docker compose, by trying setup a Wordpress standalone without a DB to simulate how it would be in the Cloud environment since the WordPress container would be standalone and then after be connected to the Amazon Relational Database Service. I did work flawlessly so I also tried out docker swarm since I wanted to use secrets within the docker compose.
note: docker secrets are only available for use when using a stack, this simply means using docker swarm technology
To create a docker secrets execute the following command:
echo "SECRET VALUE" | docker secret create DOCKER_SECRET_NAME
then to use this in a docker-compose.yaml
you have to implement it the following way:
version: '3.1'
services:
wordpress:
image: wordpress:latest
volumes:
- wp_data:/var/www/html
ports:
- 8080:80
restart: always
environment:
- WORDPRESS_DB_HOST=db
- WORDPRESS_DB_USER_FILE=/run/secrets/wp_db_user
- WORDPRESS_DB_PASSWORD_FILE=/run/secrets/wp_db_password
- WORDPRESS_DB_NAME_FILE=/run/secrets/wp_db_name
secrets:
- wp_db_user
- wp_db_password
- wp_db_name
volumes:
wp_data:
secrets:
wp_db_user:
external: true
wp_db_password:
external: true
wp_db_name:
external: true
this is a example wordpress docker-compose minus the db service part
Daily Log 05.03.2025 - Daily Results
Daily Log 05.03.2025 - Problems
problems occured with dockerfile building own image, it runs successfully no errors during build process but it wont show anything, need to revise next day 06.03.2025.
Daily Log 05.03.2025 - Used Resources
Daily Log 05.03.2025 - Exercise
docker compose -f docker-compose-wordpress.yaml up
services:
wordpress:
image: wordpress:latest
volumes:
- wp_data:/var/www/html
ports:
- 8080:80
restart: always
environment:
- WORDPRESS_DB_HOST=db
- WORDPRESS_DB_USER=wpuser
- WORDPRESS_DB_PASSWORD=genericaahpassword
- WORDPRESS_DB_NAME=wp
volumes:
wp_data:
Daily Log 06.03.2025
Daily Log 06.03.2025 - Activity
Task | Description | Notes | Status | Start Date | Completion Date | Hours Needed |
---|---|---|---|---|---|---|
Make custom WordPress Dockerfile | Create custom WordPress Dockerfile, for push to ECR | Create Dockerfile with additional funciton like setup script for automatic startup of plugins | ✅ | 05.03.2025 | 06.03.2025 | 5 hrs |
Daily Log 06.03.2025 - Summary
I initially wanted to build the Dockerfile completly from scratch meaning, cloning the official wordpress repository and make a Dockerfile that provisions everything that way, however I quickly realized that this wont work in the long run since that in itself is a whole project. So I opted for the most efficient solution; Making a Dockerfile based on the official WordPress docker image, and making modification upon that. These modifications include automatic installation of plugins and their activation triggered by wp-setup.sh
Daily Log 06.03.2025 - Daily Results
This is the WordPress container running on
localhost:8080
as said it doesn't have a database attached to it.¨
The Dockerfile is quite simply built:
# Start from the official WordPress image
FROM wordpress:latest
# Example: Copy custom plugins or themes (adjust paths as needed)
COPY ./plugins /var/www/html/wp-content/plugins/
COPY ./themes /var/www/html/wp-content/themes/
# Example: Set recommended PHP settings (optional)
RUN echo "upload_max_filesize=64M" >> /usr/local/etc/php/conf.d/uploads.ini \
&& echo "post_max_size=64M" >> /usr/local/etc/php/conf.d/uploads.ini
# Install wp-cli for plugin activation (optional step if you want pre-activation)
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && \
chmod +x wp-cli.phar && \
mv wp-cli.phar /usr/local/bin/wp
# Copy a helper script to pre-activate plugins
COPY wp-setup.sh /docker-entrypoint-initwp.d/
# Ensure script has execution permissions
RUN chmod +x /docker-entrypoint-initwp.d/wp-setup.sh
# Set correct permissions (optional)
RUN chown -R www-data:www-data /var/www/html/wp-content
# Expose Port
EXPOSE 80
note: all plugins and themes as well as the helper script must be in the same directory see following file tree for further understanding
wp-build/
├── Dockerfile
├── wp-setup.sh
├── plugins/
│ ├── plugin1/
│ ├── plugin2/
├── themes/
│ ├── theme1/
│ ├── theme2/
Daily Log 06.03.2025 - Problems
As previously alluded to I had problems with building my own Dockerfile from scratch. It did build the Docker image with no problems yet it had problems when actually running the docker image in a container. It deployed the WordPress fine and the ports where also accessible yet the problem was that no formular was received on the browser when trying to access it, this is understandably a major problem. I tried to troubleshoot for hours, I did the following things:
- changing build distribution: maybe the underlying OS of the container wasn't quite up to the task
- exposing different ports: exposing different ports for the container maybe some not properly deleted container still was running on the specified default ports.
- Troubleshooting with AI: Using AI Models specifically trained for that use case didnt help
- Additional Args during run command: When running
docker run
giving additional arguments like--network
or-v
anddb
In the end I settled for the most efficient and simple solution; Rebuilding the WordPress image
Daily Log 06.03.2025 - Used Resources
Daily Log 06.03.2025 - Exercise
Creating the Dockerfile was a exercise
Daily Log 09.03.2025
The daily activities of 09.03.2025
Daily Log 09.03.2025 - Activity
Task | Description | Notes | Status | Start Date | Completion Date | Hours Needed |
---|---|---|---|---|---|---|
Demo workflow pushing simple Hello World image into AWS ECR | Implement a basic workflow for container image deployment | Validate successful push to AWS ECR | ❌ | --- | --- | --- |
Demo "Hello World Image" to ECS task accessible via public subnet | Deploy and test a containerized app on ECS | Ensure public accessibility | ❌ | --- | --- | --- |
Daily Log 09.03.2025 - Summary
I WAS SICK
Daily Log 09.03.2025 - Daily Results
I WAS SICK
Daily Log 09.03.2025 - Problems
I WAS SICK
Daily Log 09.03.2025 - Used Resources
I WAS SICK
Daily Log 09.03.2025 - Exercise
I WAS SICK
Weekly Summary - 03.03.2025 - 09.03.2025
Weekly Summary - 03.03.2025 - 09.03.2025 - Activity
- Created and configured a Virtual Private Cloud (VPC) in AWS.
- Conducted extensive research on CI/CD workflows, automation, and Terraform integration with GitHub for AWS ECR.
- Revised and experimented with Docker Compose basics, creating standalone WordPress containers.
- Developed and finalized a custom WordPress Dockerfile, including automation scripts for plugin setup and activation.
Weekly Summary - 03.03.2025 - 09.03.2025 - Weekly Results
-
Successfully established a fully functional AWS VPC:
- IPv4 CIDR block: 10.0.0.0/16
- Two availability zones (us-east 1a, us-east 1b)
- Public and private subnets configured per zone
- DNS options enabled
- S3 Gateway endpoint configured
-
Documented key findings on Terraform and GitHub Actions for further implementation.
-
Successfully built and tested a custom WordPress Docker image with integrated plugins and themes, ready for AWS ECR deployment.
Weekly Summary - 03.03.2025 - 09.03.2025 - Problems
- Initial Dockerfile setup from scratch encountered significant runtime issues, such as containers running without displaying content, despite no build errors.
- Limited work progress on workflow demos due to illness toward the week's end, specifically from 09.03.2025 onwards.
Weekly Summary - 03.03.2025 - 09.03.2025 - Open Questions
- How to effectively resolve Docker container visibility issues when building from scratch?
- Optimal method for seamless ECS task deployments and verification of public accessibility?
- Strategies for efficient catch-up on incomplete tasks due to illness-related delays?