https://github.com/marcelotsvaz/vaz-projects
VAZ Projects website.
https://github.com/marcelotsvaz/vaz-projects
aws django docker terraform
Last synced: over 1 year ago
JSON representation
VAZ Projects website.
- Host: GitHub
- URL: https://github.com/marcelotsvaz/vaz-projects
- Owner: Marcelotsvaz
- License: unlicense
- Created: 2022-02-21T04:36:42.000Z (over 4 years ago)
- Default Branch: production
- Last Pushed: 2025-02-18T15:50:24.000Z (over 1 year ago)
- Last Synced: 2025-02-18T16:36:48.915Z (over 1 year ago)
- Topics: aws, django, docker, terraform
- Language: Python
- Homepage: https://vazprojects.com
- Size: 4.39 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
[](https://gitlab.com/marcelotsvaz/vaz-projects/-/pipelines/latest)
[](https://gitlab.com/marcelotsvaz/vaz-projects/-/pipelines/latest)
[](https://gitlab.com/marcelotsvaz/vaz-projects/-/issues/1)
# VAZ Projects Website
This is the repository for [VAZ Projects](https://vazprojects.com), my personal blog and project log. Its main purpose is to serve as a sandbox for my DevOps learning journey.
## Architecture Overview
The project consists of a Django application running on multiple EC2 instances within an Auto Scaling group. Traffic is routed to these instances using Traefik as the load balancer. A self-managed PostgreSQL instance is used as the database. Static and user-uploaded files are served through CloudFront.

GitLab is used for continuous integration and continuous delivery. Each new commit triggers a pipeline that builds container images, runs tests, and deploys the new version to a staging environment. Deployment to production can be started with manual approval.
A Grafana/Prometheus/Loki stack is used to monitor user activity, application performance and instance resource utilization, as well as ingesting logs for different services.
## Running Locally
### Install Dependencies
```sh
# Install Docker, Buildx, Docker Compose and mkcert.
pacman -S docker docker-buildx docker-compose mkcert # On Arch Linux.
```
You might need to enable buildx by default with `docker buildx install`.
### Project Setup
```sh
# Clone the repository.
git clone https://gitlab.com/marcelotsvaz/vaz-projects.git
cd vaz-projects/
# Create certificates with mkcert.
mkdir -p deployment/tls/
mkcert -ecdsa -install # If not done yet.
mkcert -ecdsa -key-file deployment/tls/websiteKey.pem -cert-file deployment/tls/website.crt localhost minio
```
### Start Compose Project
Make sure you have ports 80, 443, 8080, 9000 and 9001 available.
```sh
# Build the application image and start all containers.
docker compose up --detach --build
# Create account for Django admin.
docker compose run --rm application 'manage.py createsuperuser'
```
The following URLs will be available:
- Application: https://localhost/
- Django admin: https://localhost/admin/
- Traefik dashboard: http://localhost:8080/dashboard/
- MinIO console: https://localhost:9001/
### Running Tests
```sh
# Run unit tests and generate coverage report.
docker compose run --rm --build application 'coverage run manage.py test && coverage report'
```
### Development
```sh
# Mount the application folder and the compiled LESS file into the container so you can test changes without rebuilding the image.
docker compose -f compose.yaml -f development.compose.yaml up --detach --build
```
### Cleanup
```sh
# Stop and remove all containers, data is preserved in named volumes.
docker compose down
# Stop and remove all containers, including volumes.
docker compose down --volumes
```