-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: adding app to the docker-compose & update README.md
- Loading branch information
Showing
4 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ DB_USER= | |
DB_PASSWORD= | ||
DB_NAME= | ||
DB_PORT= | ||
API_KEY= | ||
ACCESS_TOKEN_AUTH= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,37 @@ | ||
## Movies | ||
|
||
## Prerequisites | ||
|
||
1. Golang go1.20.7 | ||
2. Docker | ||
3. Access Token Auth (You need to get a one from IMDB API) | ||
|
||
## Overview | ||
|
||
This is a service for gitting the latest movies from IMDB API, feed the database with the latest movies and expose it throgh a gRPC connection. This service fetches a new movie from IMDB every 3 seconds and if the latest movie is not exists in the database it will insert it into the database. | ||
|
||
## Important commands to compile the protocol buffers | ||
|
||
```sh | ||
|
||
$ export PATH="$PATH:$(go env GOPATH)/bin" | ||
$ protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative proto/movies.proto | ||
|
||
``` | ||
|
||
## Fill the ".env" file | ||
|
||
``` | ||
DB_HOST= | ||
DB_USER= | ||
DB_PASSWORD= | ||
DB_NAME= | ||
DB_PORT= | ||
ACCESS_TOKEN_AUTH= | ||
``` | ||
|
||
## How to run? | ||
|
||
``` | ||
$ docker-compose up | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM golang:1.20 | ||
|
||
WORKDIR /app | ||
|
||
COPY go.mod go.sum ./ | ||
|
||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux go build -o /movies | ||
|
||
EXPOSE 50051 | ||
|
||
CMD ["/movies"] |