🐳 docker-compose volume mappings
This commit is contained in:
21
README.md
21
README.md
@@ -15,14 +15,16 @@ ThreeTwo! currently is set up as:
|
|||||||
## Docker Instructions
|
## Docker Instructions
|
||||||
|
|
||||||
The recommended approach is to simply use `docker-compose` which spins up containers for the UI and all the associated microservices and data store.
|
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:
|
Make sure that you have `docker` and `docker-compose` installed. Running `docker system prune -a` can help free up some space.
|
||||||
Make sure that you have `docker` and `docker-compose` installed.
|
|
||||||
|
Then:
|
||||||
|
|
||||||
1. Clone this repo using `git clone https://github.com/rishighan/threetwo.git`
|
1. Clone this repo using `git clone https://github.com/rishighan/threetwo.git`
|
||||||
2. Create an external docker network using `docker network create proxy`
|
2. Create an external docker network using `docker network create proxy`
|
||||||
3. Run `docker-compose up --build -d`
|
3. Run `docker-compose up --build -d` to run the containers in detatched mode
|
||||||
4. Note that the first time, the process could take up to 10 minutes, since it is building containers for `threetwo`, `threetwo-import-service`, `comicvine-service`, `mongo`, `nats`, `nginx`
|
4. For debugging you can leave out the `-d` flag
|
||||||
5. For posterity, check that all containers are up using `docker ps`
|
5. Note that the first time, the process could take up to 10 minutes, since it is building containers for `threetwo`, `threetwo-import-service`, `comicvine-service`, `mongo`, `nats`, `nginx`
|
||||||
|
6. For posterity, check that all containers are up using `docker ps`
|
||||||
|
|
||||||
## Local Development
|
## Local Development
|
||||||
|
|
||||||
@@ -33,3 +35,12 @@ For debugging and troubleshooting, you can run this app locally using these step
|
|||||||
3. This will open `http://localhost:3050` in your default browser
|
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.
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
### Docker
|
||||||
|
|
||||||
|
1. `docker-compose up` is taking a long time
|
||||||
|
This is primarily because `threetwo-import-service` pulls `calibre` from the CDN and it has been known to be extremely slow. I can't find a more reliable alternative, so give it some time to finish downloading.
|
||||||
|
|
||||||
|
2. What folder do my comics go in?
|
||||||
|
Currently, in the `docker-compose` setup, the `comics` folder at the root of this repo is used to store comics.
|
||||||
|
|||||||
0
contributing.md
Normal file
0
contributing.md
Normal file
@@ -1,14 +1,6 @@
|
|||||||
version: "3.7"
|
version: "3.7"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
nginx:
|
|
||||||
image: nginx
|
|
||||||
container_name: proxy
|
|
||||||
ports:
|
|
||||||
- "80:80"
|
|
||||||
volumes:
|
|
||||||
- ./proxy.conf:/etc/nginx/conf.d/default.conf
|
|
||||||
|
|
||||||
threetwo:
|
threetwo:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
@@ -29,7 +21,9 @@ services:
|
|||||||
- "3080:3080"
|
- "3080:3080"
|
||||||
environment:
|
environment:
|
||||||
SERVICES: api
|
SERVICES: api
|
||||||
env_file: comicvine-service.env
|
env_file: ./docker-env/comicvine-service.env
|
||||||
|
volumes:
|
||||||
|
- 'userdata:/comicvine-service/userdata'
|
||||||
depends_on:
|
depends_on:
|
||||||
- nats
|
- nats
|
||||||
networks:
|
networks:
|
||||||
@@ -42,7 +36,7 @@ services:
|
|||||||
container_name: comicvine-service
|
container_name: comicvine-service
|
||||||
environment:
|
environment:
|
||||||
SERVICES: comicvine
|
SERVICES: comicvine
|
||||||
env_file: comicvine-service.env
|
env_file: ./docker-env/comicvine-service.env
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
|
|
||||||
@@ -55,7 +49,10 @@ services:
|
|||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
environment:
|
environment:
|
||||||
SERVICES: api
|
SERVICES: api
|
||||||
env_file: threetwo-import-service.env
|
env_file: ./docker-env/threetwo-import-service.env
|
||||||
|
volumes:
|
||||||
|
- 'userdata:/threetwo-import-service/userdata'
|
||||||
|
- 'comics:/threetwo-import-service/comics'
|
||||||
depends_on:
|
depends_on:
|
||||||
- nats
|
- nats
|
||||||
- mongodb
|
- mongodb
|
||||||
@@ -72,7 +69,7 @@ services:
|
|||||||
- nats
|
- nats
|
||||||
environment:
|
environment:
|
||||||
SERVICES: import
|
SERVICES: import
|
||||||
env_file: threetwo-import-service.env
|
env_file: ./docker-env/threetwo-import-service.env
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
|
|
||||||
@@ -86,7 +83,7 @@ services:
|
|||||||
- nats
|
- nats
|
||||||
environment:
|
environment:
|
||||||
SERVICES: imagetransformation
|
SERVICES: imagetransformation
|
||||||
env_file: threetwo-import-service.env
|
env_file: ./docker-env/threetwo-import-service.env
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
|
|
||||||
@@ -105,12 +102,22 @@ services:
|
|||||||
container_name: transporter
|
container_name: transporter
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
|
|
||||||
|
nginx:
|
||||||
|
image: nginx
|
||||||
|
container_name: proxy
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
volumes:
|
||||||
|
- ./proxy.conf:/etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
proxy:
|
proxy:
|
||||||
external: true
|
external: true
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
|
userdata:
|
||||||
|
comics:
|
||||||
mongodb_data:
|
mongodb_data:
|
||||||
driver: local
|
driver: local
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ server {
|
|||||||
server {
|
server {
|
||||||
listen 3000;
|
listen 3000;
|
||||||
|
|
||||||
location /comicvine-service {
|
location /import-service {
|
||||||
proxy_pass http://host.docker.internal:3000;
|
proxy_pass http://host.docker.internal:3000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user