update readme, dockerfile and makefile

This commit is contained in:
Pedro Pérez 2024-11-25 16:18:10 +01:00
parent 958ef12e91
commit 430892a512
3 changed files with 26 additions and 30 deletions

View File

@ -1,52 +1,53 @@
# Rating Orama # Rating Orama
Rating Orama is a web application for displaying TV show ratings and statistics. It is composed of 3 main parts: Rating Orama is a web application for displaying TV show ratings and statistics.
It is composed of 2 main parts:
1. **Core**: Written in Go and Fiber, responsible for orchestrating everything and displaying the data using a template engine. 1. **Core**: Written in Go and Fiber, responsible for orchestrating everything
2. **Harvester**: Written in Python, Flask, and Cinemagoer, responsible for collecting data for the core. and displaying the data using a template engine.
3. **Database**: PostgreSQL for storing data. 3. **Database**: PostgreSQL for storing data.
## Running the project ## Running the project
There are two ways to run the project: launching each part individually or building the Dockerfile and running it using Docker Compose. Here's an example of the `docker-compose.yml` file for the latter option: There are two ways to run the project: launching each part individually or
building the Dockerfile and running it using Docker Compose. Here's an example
of the `docker-compose.yml` file for the latter option:
```yaml ```yaml
version: '3' version: '3'
services: services:
harvester:
container_name: harvester-ratingorama
image: harvester:0.1.0
networks:
- ratingorama
core: core:
container_name: core-ratingorama container_name: core-ratingorama
image: core:0.1.0 image: core:latest
environment: environment:
DATASOURCE: ${DATASOURCE} DATASOURCE: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?sslmode=disable
HARVESTER_API: ${HARVESTER_API}
IS_PRODUCTION: ${IS_PRODUCTION}
ports: ports:
- "3000:3000" - "8080:8080"
networks: networks:
- ratingorama - ratingorama
db: db:
container_name: db-ratingorama container_name: db-ratingorama
image: postgres:15.2-alpine image: postgres:16.3-alpine3.20
environment: environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports: ports:
- "5433:5432" - "5432:5432"
volumes: volumes:
- ./schema.sql:/docker-entrypoint-initdb.d/schema.sql - rating-orama_data:/var/lib/postgresql/data
- ./data:/var/lib/postgresql/data
networks: networks:
- ratingorama - ratingorama
networks: networks:
ratingorama: ratingorama:
volumes:
rating-orama_data:
``` ```
## Contributions ## Contributions
If you have ideas for improvements or bug fixes, feel free to contribute! To do so, simply clone the repository, create a new branch, and submit a pull request. If you have ideas for improvements or bug fixes, feel free to contribute! To do
so, simply clone the repository, create a new branch, and submit a pull request.

View File

@ -1,13 +1,8 @@
FROM golang:1.20.3-alpine FROM alpine:3.20
WORKDIR /app WORKDIR /app
COPY go.mod go.sum ./ COPY ./database ./database
COPY ./tmp/rating .
RUN go mod download CMD ["/app/rating"]
COPY . .
RUN go build -o main
CMD ["/app/main"]

View File

@ -38,7 +38,7 @@ test:
.PHONY: gomock .PHONY: gomock
# Generate mock files. # Generate mock files.
gomock: gomock:
mockgen -package mock -destination internal/repository/mock/querier.go arena-coins/internal/repository ExtendedQuerier mockgen -package mock -destination internal/repository/mock/querier.go rating-orama/internal/repository ExtendedQuerier
.PHONY: run .PHONY: run
# Run project. # Run project.
@ -70,7 +70,7 @@ build-linux:
pack-docker: pack-docker:
make test make test
make build-linux make build-linux
docker build -t arena-coins:${version} -t arena-coins:latest . docker build -t rating-orama:${version} -t rating-orama:latest .
.PHONY: remove-debug .PHONY: remove-debug
# Remove all debug entries for reduce size binary. # Remove all debug entries for reduce size binary.