Skip to content

Commit 3305224

Browse files
committed
add infrastructure dir and adapt docker file locations
1 parent ee9a75d commit 3305224

11 files changed

+114
-4
lines changed

docker-compose.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
conferences:
1111
build:
1212
context: .
13-
dockerfile: src/docker/Dockerfile.conferences
13+
dockerfile: infrastructure/docker/Dockerfile.conferences
1414
command: uvicorn main:app --host 0.0.0.0 --reload # sleep 9999999999
1515
depends_on:
1616
- redis
@@ -27,7 +27,7 @@ services:
2727
telegram:
2828
build:
2929
context: .
30-
dockerfile: src/docker/Dockerfile.telegram
30+
dockerfile: infrastructure/docker/Dockerfile.telegram
3131

3232
command: python workers/telegram.py # sleep 99999
3333
depends_on:
@@ -44,7 +44,7 @@ services:
4444
push_notifications:
4545
build:
4646
context: .
47-
dockerfile: src/docker/Dockerfile.push_notifications
47+
dockerfile: infrastructure/docker/Dockerfile.push_notifications
4848

4949
command: python workers/push_notifications.py # sleep 99999
5050
depends_on:
@@ -64,4 +64,4 @@ services:
6464
POSTGRES_PASSWORD: sfscon
6565
hostname: postgres
6666
volumes:
67-
- /tmp/epaper_pgdata:/var/lib/postgresql/data
67+
- /tmp/epaper_pgdata:/var/lib/postgresql/data

infrastructure/ansible/ansible.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[defaults]
2+
inventory = ./hosts
3+
roles_path = ./roles
4+
retry_files_enabled = False

infrastructure/ansible/deploy.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
- hosts: all
3+
vars:
4+
ansible_python_interpreter: /usr/bin/python3
5+
tasks:
6+
- name: Login to GitHub Container Registry
7+
ansible.builtin.shell:
8+
cmd: echo "{{ docker_password }}" | docker login "{{ docker_host }}" --username "{{ docker_username }}" --password-stdin
9+
- name: Execute Docker deployment
10+
ansible.builtin.include_role:
11+
name: ansible-docker-deployment
12+
vars:
13+
docker_deployment_project_name: '{{ project_name }}'
14+
docker_deployment_release_name: '{{ release_name }}'
15+
docker_deployment_release_files:
16+
- local: ../docker-compose.run.yml
17+
remote: docker-compose.yml
18+
- local: ../../.env
19+
remote: .env

infrastructure/ansible/hosts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[test]
2+
docker03.testingmachine.eu ansible_user='noi-techpark-bot' ansible_ssh_common_args='-o StrictHostKeyChecking=no'
3+
4+
[prod]
5+
docker03.opendatahub.bz.it ansible_user='noi-techpark-bot' ansible_ssh_common_args='-o StrictHostKeyChecking=no'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- src: git+https://github.com/noi-techpark/ansible-docker-deployment.git
2+
version: "2.0"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
services:
2+
3+
conferences:
4+
image: ${DOCKER_IMAGE_CONFERENCES}:${DOCKER_TAG}
5+
env_file:
6+
- ../.env
7+
build:
8+
context: ../
9+
dockerfile: infrastructure/docker/Dockerfile.conferences
10+
11+
push_notifications:
12+
image: ${DOCKER_IMAGE_PUSH_NOTIFICATIONS}:${DOCKER_TAG}
13+
env_file:
14+
- ../.env
15+
build:
16+
context: ../
17+
dockerfile: infrastructure/docker/Dockerfile.push_notifications
18+
19+
telegram:
20+
image: ${DOCKER_IMAGE_TELEGRAM}:${DOCKER_TAG}
21+
env_file:
22+
- ../.env
23+
build:
24+
context: ../
25+
dockerfile: infrastructure/docker/Dockerfile.telegram

infrastructure/docker-compose.run.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
services:
2+
3+
conferences:
4+
image: ${DOCKER_IMAGE_CONFERENCES}:${DOCKER_TAG}
5+
command: uvicorn main:app --host 0.0.0.0 --reload # sleep 9999999999
6+
env_file:
7+
- ../.env
8+
ports:
9+
- "${SERVER_PORT_CONFERENCES}:8000"
10+
volumes:
11+
- opencon-logs:/var/log/opencon
12+
13+
push_notifications:
14+
image: ${DOCKER_IMAGE_PUSH_NOTIFICATIONS}:${DOCKER_TAG}
15+
command: python workers/push_notifications.py # sleep 99999
16+
env_file:
17+
- ../.env
18+
ports:
19+
- "${API_SERVER_PORT_PUSH_NOTIFICATIONS}:8080"
20+
volumes:
21+
- opencon-logs:/var/log/opencon
22+
23+
telegram:
24+
image: ${DOCKER_IMAGE_TELEGRAM}:${DOCKER_TAG}
25+
command: python workers/telegram.py # sleep 99999
26+
env_file:
27+
- ../.env
28+
ports:
29+
- "${API_SERVER_PORT_TELEGRAM}:8080"
30+
volumes:
31+
- opencon-logs:/var/log/opencon
32+
33+
postgres:
34+
image: "postgres:14-alpine"
35+
environment:
36+
POSTGRES_DB: sfscon
37+
POSTGRES_USER: sfscon
38+
POSTGRES_PASSWORD: sfscon
39+
hostname: postgres
40+
volumes:
41+
- postgres-data:/var/lib/postgresql/data
42+
43+
redis:
44+
command: redis-server
45+
hostname: redis
46+
image: redis:alpine
47+
labels:
48+
NAME: redis
49+
50+
volumes:
51+
opencon-logs:
52+
postgres-data:
53+

0 commit comments

Comments
 (0)