diff --git a/README.md b/README.md index e678c75..fd2f90d 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,17 @@ ThreeTwo! currently is set up as: 3. `comicvine-service` [https://github.com/rishighan/comicvine-service] ## Local Development -1. Clone this repo -2. `yarn run dev` (you can ignore the warnings) -3. +The recommended approach is to simply use `docker-compose` which spins up containers for the UI and all the associated microservices and data store. +To do that: + +1. Clone this repo using `git clone https://github.com/rishighan/threetwo.git` +2. Run `docker-compose up --build -d` +3. Note that the first time, the process could take up to 10 minutes + +However, for debugging and troubleshooting, you can run this app locally using these steps: + +1. Clone this repo using `git clone https://github.com/rishighan/threetwo.git` +2. `yarn run dev` (you can ignore the warnings) +3. This will open `http://localhost:3050` in your default browser +4. Note that this is simply the UI layer and won't offer anything beyond a scaffold. You have to spin up the microservices locally to get it to work. diff --git a/comicvine-service.env b/comicvine-service.env new file mode 100644 index 0000000..68dcb92 --- /dev/null +++ b/comicvine-service.env @@ -0,0 +1,9 @@ +NAMESPACE= +LOGGER=true +LOGLEVEL=info +SERVICEDIR=dist/services + +TRANSPORTER=nats://nats:4222 + +CACHER=Memory + diff --git a/docker-compose.yml b/docker-compose.yml index bbb8e73..ff844f6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,6 +3,7 @@ version: "3.7" services: nginx: image: nginx + container_name: proxy ports: - "80:80" volumes: @@ -21,12 +22,14 @@ services: comicvineapi: build: - context: . + context: https://github.com/rishighan/comicvine-service.git image: frishi/comicvine-service container_name: comicvine-api + ports: + - "3080:3080" environment: SERVICES: api - PORT: 3080 + env_file: comicvine-service.env depends_on: - nats networks: @@ -34,16 +37,55 @@ services: comicvine: build: - context: . + context: https://github.com/rishighan/comicvine-service.git image: frishi/comicvine-service container_name: comicvine-service + environment: + SERVICES: comicvine + env_file: comicvine-service.env + networks: + - proxy + + importapi: + build: + context: https://github.com/rishighan/threetwo-import-service.git + image: frishi/threetwo-import-service + container_name: threetwo-import-api ports: - - "3080:3080" + - "3000:3000" + environment: + SERVICES: api + env_file: threetwo-import-service.env + depends_on: + - nats + networks: + - proxy + + import: + build: + context: https://github.com/rishighan/threetwo-import-service.git + image: frishi/threetwo-import-service + container_name: import + environment: + SERVICES: import + env_file: threetwo-import-service.env + networks: + - proxy + + imagetransformation: + build: + context: https://github.com/rishighan/threetwo-import-service.git + image: frishi/threetwo-import-service + container_name: image-transformation + environment: + SERVICES: imagetransformation + env_file: threetwo-import-service.env networks: - proxy nats: image: nats:2 + container_name: transporter networks: - proxy diff --git a/proxy.conf b/proxy.conf index 0e12873..077e42a 100644 --- a/proxy.conf +++ b/proxy.conf @@ -1,16 +1,22 @@ server { - listen 8050; - + listen 8050; location / { proxy_pass http://host.docker.internal:8050; } +} - location /import-service { - proxy_pass http://host.docker.internal:3000; - } - +server { + listen 3080; + location /comicvine-service { proxy_pass http://host.docker.internal:3080; } +} +server { + listen 3000; + + location /comicvine-service { + proxy_pass http://host.docker.internal:3000; + } } \ No newline at end of file diff --git a/threetwo-import-service.env b/threetwo-import-service.env new file mode 100644 index 0000000..68dcb92 --- /dev/null +++ b/threetwo-import-service.env @@ -0,0 +1,9 @@ +NAMESPACE= +LOGGER=true +LOGLEVEL=info +SERVICEDIR=dist/services + +TRANSPORTER=nats://nats:4222 + +CACHER=Memory +