Skip to content

Commit

Permalink
Move docker configs to .docker folder similarly to .github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliya-ivaniukovich committed Apr 17, 2020
1 parent 85a2f11 commit 50b7121
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 27 deletions.
5 changes: 2 additions & 3 deletions docker/.env → .docker/.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ PROFILE=default
# Local storage service environment variables
LOCAL_STORAGE_SERVICE_DATABASE_USER=admin
LOCAL_STORAGE_SERVICE_DATABASE_PASSWORD=admin
LOCAL_STORAGE_SERVICE_DISK_MIN_SPACE_THRESHOLD=5GB

RABBITMQ_DEFAULT_USER=admin
RABBITMQ_DEFAULT_PASSWORD=admin
AMQP_SERVER_USER=admin
AMQP_SERVER_PASSWORD=admin
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ server {
client_body_timeout 30s;

location /api/files {
proxy_pass http://local-storage-service:8080/api/files;
proxy_pass http://file-storage:8080/api/files;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}

location /api/status/file-storage {
proxy_pass http://local-storage-service:8080/api/status;
proxy_pass http://file-storage:8080/api/status;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ services:
ports:
- 80:80
depends_on:
- local-storage-service
- file-storage
- job-service
38 changes: 22 additions & 16 deletions docker/docker-compose.yml → .docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,60 @@
version: '3.4'
services:
local-storage-service-database:
build: ./database
restart: always
# File Storage
local-storage-database:
build: ./localstorage-db
environment:
POSTGRES_USER: ${LOCAL_STORAGE_SERVICE_DATABASE_USER}
POSTGRES_PASSWORD: ${LOCAL_STORAGE_SERVICE_DATABASE_PASSWORD}
POSTGRES_DB: verapdfdb
volumes:
- type: volume
source: filestorage_database_data
source: localstorage_database_data
target: /var/lib/postgresql/data
local-storage-service:
restart: always
file-storage:
build: ../local-storage-service/server
expose:
- 8080
depends_on:
- local-storage-service-database
- local-storage-database
environment:
LOCALSTORAGE_DATABASE_USERNAME: ${LOCAL_STORAGE_SERVICE_DATABASE_USER}
LOCALSTORAGE_DATABASE_PASSWORD: ${LOCAL_STORAGE_SERVICE_DATABASE_PASSWORD}
LOCALSTORAGE_DATABASE_DB: verapdfdb # the same as in local-storage-service-database
LOCALSTORAGE_DATABASE_HOST: local-storage-service-database
LOCALSTORAGE_DATABASE_DB: verapdfdb # the same as in file-storage-database
LOCALSTORAGE_DATABASE_HOST: local-storage-database
LOCALSTORAGE_DATABASE_PORT: 5432
LOCALSTORAGE_DISK_MIN_SPACE_THRESHOLD: ${LOCAL_STORAGE_SERVICE_DISK_MIN_SPACE_THRESHOLD}
LOCALSTORAGE_DISK_MIN_SPACE_THRESHOLD: ${LOCAL_STORAGE_SERVICE_DISK_MIN_SPACE_THRESHOLD:-5GB}
LOCALSTORAGE_MAX_FILE_SIZE: 100MB
LOCALSTORAGE_MAX_REQUEST_SIZE: 101MB
volumes:
- type: volume
source: filestorage_server_files
source: localstorage_server_files
target: /opt/verapdf/localstorageservice/files
restart: always

# Job Service
job-service:
build: ../job-service/server
expose:
- 8080
restart: always

rabbitmq:
build: ./rabbitmq
# Validation tasks queue
queue:
image: rabbitmq:3.8.3
expose:
- 5672
restart: always
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER}
RABBITMQ_DEFAULT_PASSWORD: ${RABBITMQ_DEFAULT_PASSWORD}
RABBITMQ_DEFAULT_USER: ${AMQP_SERVER_USER}
RABBITMQ_DEFAULT_PASSWORD: ${AMQP_SERVER_PASSWORD}
volumes:
- type: volume
source: rabbitmq_database_data
target: /var/lib/rabbitmq/

volumes:
filestorage_database_data:
filestorage_server_files:
localstorage_database_data:
localstorage_server_files:
rabbitmq_database_data:
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mvn clean install

**Run service stack**
```
cd ./docker
cd .docker
docker-compose up -d
```

Expand All @@ -26,15 +26,15 @@ To check service availability you can request service status endpoints described

**Stop service stack**
```
cd ./docker
cd .docker
docker-compose down
```

## Dev environment
When working on new features it is useful to be able to launch individual services in your IDE directly.
To use your local services you can start the stack with `PROFILE=dev` environment variable:
```
cd ./docker
cd .docker
env PROFILE=dev docker-compose up -d
```
This will launch the nginx proxy with alternative configuration pointing to your services instead of those from
Expand Down
2 changes: 0 additions & 2 deletions docker/rabbitmq/Dockerfile

This file was deleted.

0 comments on commit 50b7121

Please sign in to comment.