Skip to content

Commit 4d9c0d1

Browse files
feat: add databases to aws setup and test new valu einjection
1 parent 7c02f31 commit 4d9c0d1

File tree

4 files changed

+36
-9
lines changed

4 files changed

+36
-9
lines changed

.github/workflows/terraform-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ jobs:
7171
echo "=== Testing SSH Connection ==="
7272
ssh -i vockey.pem -o StrictHostKeyChecking=no ubuntu@${{ steps.terraform.outputs.public_ip }} "echo 'SSH connection successful'"
7373
echo "=== Running Ansible Playbook ==="
74-
ANSIBLE_HOST_KEY_CHECKING=False ANSIBLE_DEBUG=1 ansible-playbook -i inventory.yml playbooks/deploy.yml -vvv --extra-vars "ansible_host=${{ steps.terraform.outputs.public_ip }}" --start-at-task="Test connection"
74+
ANSIBLE_HOST_KEY_CHECKING=False ANSIBLE_DEBUG=1 ansible-playbook -i inventory.yml playbooks/deploy.yml -vvv --extra-vars "ansible_host=${{ steps.terraform.outputs.public_ip }} EC2_PUBLIC_IP=${{ steps.terraform.outputs.public_ip }}" --start-at-task="Test connection"

deployment/compose.aws.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,34 @@ services:
113113
networks:
114114
- backend
115115

116+
match-database:
117+
image: mysql:8.0
118+
container_name: meetatmensa-matchdb
119+
environment:
120+
- MYSQL_ROOT_PASSWORD=root
121+
volumes:
122+
- matchdb_data:/var/lib/mysql
123+
expose:
124+
- "3306"
125+
networks:
126+
- backend
127+
128+
user-database:
129+
image: mysql:8.0
130+
container_name: meetatmensa-userdb
131+
environment:
132+
- MYSQL_ROOT_PASSWORD=root
133+
volumes:
134+
- userdb_data:/var/lib/mysql
135+
expose:
136+
- "3306"
137+
networks:
138+
- backend
139+
116140
networks:
117141
backend:
118142
driver: bridge
143+
144+
volumes:
145+
matchdb_data:
146+
userdb_data:

infrastructure/ansible/playbooks/deploy.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@
8989
dest: "{{ deployment_dir }}/compose.aws.yml"
9090
mode: "0644"
9191

92-
- name: Create .env.prod file
92+
- name: Create .env file for Docker Compose
9393
template:
9494
src: "{{ playbook_dir }}/../templates/env.prod.j2"
95-
dest: "{{ app_dir }}/.env.prod"
95+
dest: "{{ deployment_dir }}/.env"
9696
mode: "0644"
9797

9898
- name: Start Docker Compose
@@ -104,5 +104,4 @@
104104
build: always
105105
remove_orphans: yes
106106
environment:
107-
DOCKER_BUILDKIT: 1
108-
EC2_PUBLIC_IP: "{{ ansible_host }}"
107+
DOCKER_BUILDKIT: 1
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
EC2_PUBLIC_IP={{ lookup('env', 'EC2_PUBLIC_IP') }}
2-
CLIENT_HOST=client.{{ lookup('env', 'EC2_PUBLIC_IP') }}.nip.io
3-
SERVER_HOST=api.{{ lookup('env', 'EC2_PUBLIC_IP') }}.nip.io
4-
PUBLIC_API_URL=https://api.{{ lookup('env', 'EC2_PUBLIC_IP') }}.nip.io
1+
EC2_PUBLIC_IP={{ EC2_PUBLIC_IP }}
2+
CLIENT_HOST=client.{{ EC2_PUBLIC_IP }}.nip.io
3+
SERVER_HOST=api.{{ EC2_PUBLIC_IP }}.nip.io
4+
PUBLIC_API_URL=https://api.{{ EC2_PUBLIC_IP }}.nip.io

0 commit comments

Comments
 (0)