Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fourth #25

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions .github/workflows/commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Checkout cache
uses: actions/[email protected]

- name: Start installation process
run: npm i

Expand All @@ -44,4 +41,18 @@ jobs:
run: npm run test

- name: Check E2E tests
run: npm run test:e2e
run: npm run test:e2e

- name: Login to Docker Hub
uses: docker/login-action@1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./dockerfile
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/simplewhale:latest
1 change: 1 addition & 0 deletions apps/anime-service/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git
27 changes: 26 additions & 1 deletion apps/anime-service/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,35 @@
version: "3"

services:
anime_balancer:
image: anime-balancer
container_name: anime-service-balancer
build:
context: ./nginx
dockerfile: dockerfile
environment:
- NGINX_PORT=80
ports:
- 80:80
networks:
- anime-network

db:
image: postgres
restart: always
ports:
- "5433:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: pass123
POSTGRES_PASSWORD: pass123
volumes:
- pg_data:/var/lib/postgresql/data
networks:
- anime-network

volumes:
pg_data:

networks:
anime-network:
driver: bridge
1 change: 1 addition & 0 deletions apps/anime-service/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM node:16.14.0
5 changes: 5 additions & 0 deletions apps/anime-service/nginx/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM nginx:1.23.0

RUN mkdir /etc/nginx/anime-service

COPY ./nginx.conf /etc/nginx/anime-service/
23 changes: 23 additions & 0 deletions apps/anime-service/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
worker_processes 1;

events {
worker_connections 512;
}

http {
upstream anime_service {
server anime_service_1:5000;
server anime_service_2:5000;
server anime_service_3:5000;
}

server {
listen 80;

location / {
access_log off;

proxy_pass http://anime_service;
}
}
}
1 change: 1 addition & 0 deletions apps/auth-service/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git
27 changes: 26 additions & 1 deletion apps/auth-service/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,35 @@
version: '3.8'

services:
auth_balancer:
image: auth-balancer
container_name: auth-service-balancer
build:
context: ./nginx
dockerfile: dockerfile
environment:
- NGINX_PORT=80
ports:
- 80:80
networks:
- auth-network

postgres:
image: postgres:10.3
restart: always
environment:
POSTGRES_USER: prisma
POSTGRES_PASSWORD: pass123
ports:
- '5432:5432'
- '5432:5432'
volumes:
- pg_data:/var/lib/postgresql/data
networks:
- auth-network

volumes:
pg_data:

networks:
auth-nework:
driver: bridge
1 change: 1 addition & 0 deletions apps/auth-service/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM node:16.14.0
5 changes: 5 additions & 0 deletions apps/auth-service/nginx/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM nginx:1.23.0

RUN mkdir /etc/nginx/auth-service

COPY ./nginx.conf /etc/nginx/auth-service/
27 changes: 27 additions & 0 deletions apps/auth-service/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
worker_processes 1;

events {
worker_connections 512;
}

http {
upstream auth_service {
server auth_service_1:5500;
server auth_service_2:5500;
server auth_service_3:5500;
}

server {
listen 80;

location / {
access_log off;

proxy_pass http://auth_service;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
}
}