Skip to content

Commit fba0e3c

Browse files
authored
feat: Terraform Deployment (#27)
* chore: remove outputs * chore: add todos * chore: remove ipv4 cause aws is charging * chore: directory restructure * chore: remove public egress temp * Update README.md * feat: backend ec2 and rds in subnets * chore: prevent destroy * feat: frontend infra * route 53 dns * feat: docker setup for backend * chore: minor config changes * feat: route the traffic via alb to ec2 instead of direct ec2 * chore: cors * chore: cors * feat: ngnix config * feat: home page maintinance message
1 parent 3711a30 commit fba0e3c

37 files changed

+565
-175
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ BitMatch provides a streamlined platform where:
4646
- Terraform for infrastructure as code (IaC)
4747

4848
## 🏗 Architecture Diagram
49-
![BitMatchArchAWS](https://github.com/user-attachments/assets/68d1f250-b9d7-4c26-ba60-664380282d6e)
49+
![BitMatchAWSDiagram](https://github.com/user-attachments/assets/ebf5667b-e255-4933-bee9-9970bd0c6f9a)
5050

5151
## 🛠 Running Locally
5252

backend/.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
__pycache__/
2+
*.pyc
3+
*.pyo
4+
*.pyd
5+
.env
6+
/static

backend/.gitignore

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,6 @@ static/
3838
.DS_Store
3939
Thumbs.db
4040

41-
# Local .terraform directories
42-
.terraform/
43-
44-
# Terraform state files
45-
*.tfstate
46-
*.tfstate.*
47-
48-
# Crash log files
49-
crash.log
50-
51-
# Terraform variable files (containing sensitive data)
52-
*.tfvars
53-
*.tfvars.json
54-
55-
# Override files, which may contain sensitive data
56-
override.tf
57-
override.tf.json
58-
59-
# .terraform.lock.hcl files (optional to include, especially in team environments)
60-
.terraform.lock.hcl
61-
6241
# IDE and editor folders
6342
.vscode/
6443
.idea/

backend/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Use an official Python runtime as a parent image
2+
FROM python:3.11
3+
4+
# Set the working directory in the container
5+
WORKDIR /app
6+
7+
# Copy the requirements file and install dependencies
8+
COPY requirements.txt .
9+
RUN pip install --no-cache-dir -r requirements.txt
10+
11+
# Copy the rest of the application
12+
COPY . .
13+
14+
# Set environment variables
15+
ENV PYTHONUNBUFFERED=1
16+
17+
# Expose the port for Gunicorn
18+
EXPOSE 8000
19+
20+
# Run migrations and start Django server
21+
CMD ["sh", "-c", "python manage.py migrate && python manage.py collectstatic --noinput && gunicorn bitmatch.wsgi:application --bind 0.0.0.0:8000"]
File renamed without changes.
File renamed without changes.

backend/bitmatch/bitmatch/settings.py renamed to backend/bitmatch/settings.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,10 @@
175175
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
176176

177177
CORS_ALLOWED_ORIGINS = [
178-
"http://localhost:5173", # Vite development server URL
179-
"http://localhost:5174",
180-
"http://localhost:5175",
181-
"http://localhost:5176",
178+
"http://localhost:5173",
179+
"http://localhost:5174",
180+
"https://bitmatchapp.com",
181+
"https://api.bitmatchapp.com",
182182
]
183183

184184
CORS_ALLOW_CREDENTIALS = True
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)