Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct some problems with the docker-compose (#111)
* Correct some problems with the docker-compose Now, a simple docker-compose up starts everything (even a demo UI). For development, the docker-compose-build.yml can be used Updated the doc as well * exclude pull_request events for parsr-base and parsr-ui pipelines * trying to build API on pull_request event * fix permission issue
- Loading branch information
slallemand
authored and
Aarohi Johal
committed
Oct 10, 2019
1 parent
ba0e43d
commit 1801d98
Showing
6 changed files
with
110 additions
and
49 deletions.
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
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 |
---|---|---|
|
@@ -106,3 +106,7 @@ pipeline | |
# python / jupyter ignores | ||
.ipynb_checkpoints | ||
__pycache__ | ||
|
||
# drone | ||
.drone-secret* | ||
.tags |
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,41 @@ | ||
version: '3.3' | ||
|
||
services: | ||
# parsr-base is the baseimage with all the dependencies already installed on it | ||
# just build it if you need new dependencies otherwise use the publish one | ||
parsr-base: | ||
image: axarev/parsr-base | ||
build: | ||
context: . | ||
dockerfile: docker/parsr-base/Dockerfile | ||
|
||
# parsr API | ||
parsr: | ||
image: axarev/parsr | ||
build: | ||
context: . | ||
dockerfile: docker/parsr/Dockerfile | ||
args: | ||
DEV_MODE: 'true' | ||
ports: | ||
- 3001:3001 | ||
environment: | ||
ABBYY_SERVER_URL: | ||
volumes: | ||
- ./pipeline/:/opt/app-root/src/api/server/dist/output | ||
|
||
# parsr-ui | ||
# if the API is not running on localhost:3001, you need to rebuild the image with the correct VUE_APP_API variable | ||
parsr-ui: | ||
image: axarev/parsr-ui-localhost | ||
build: | ||
context: . | ||
dockerfile: docker/parsr-ui/Dockerfile | ||
args: | ||
VUE_APP_API: ${VUE_APP_API:-http://localhost:3001} | ||
ports: | ||
- 8080:80 | ||
|
||
volumes: | ||
pipeline: | ||
driver: local |
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 |
---|---|---|
@@ -1,15 +1,27 @@ | ||
#!/bin/sh | ||
# | ||
|
||
set -e | ||
|
||
case ${DRONE_BRANCH} in | ||
master) | ||
echo "Add \"stable\" tag" | ||
echo -n stable > .tags | ||
case ${DRONE_BUILD_EVENT} in | ||
push) | ||
case ${DRONE_BRANCH} in | ||
master) | ||
echo "Adding tags ${DRONE_BRANCH} to docker image" | ||
echo -n "${DRONE_BRANCH}" > .tags | ||
;; | ||
develop) | ||
echo "Adding tag latest,develop to docker image" | ||
echo -n latest,develop > .tags | ||
;; | ||
esac | ||
;; | ||
develop) | ||
echo "Add \"latest,develop\" tag" | ||
echo -n latest,develop > .tags | ||
tag) | ||
echo "Adding ${DRONE_TAG} tag to docker image" | ||
echo -n "${DRONE_TAG}" > .tags | ||
;; | ||
|
||
esac | ||
*) | ||
echo "Unknown DRONE_BUILD_EVENT ($DRONE_BUILD_EVENT) is not defined !" | ||
exit 2 | ||
;; | ||
esac |
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,25 +1,26 @@ | ||
# Docker | ||
|
||
## Prepare the Docker service | ||
|
||
In your docker installation's configuration, increase the amount of active memory allotted to the instance to 4GB. | ||
|
||
## Build Parsr | ||
## Run Parsr | ||
|
||
At the root of the project, launch: | ||
In the root of the repository, launch: | ||
|
||
``` | ||
docker-compose build | ||
docker-compose up | ||
``` | ||
|
||
This will build Parsr, along with its dependencies. | ||
This will start 2 containers : | ||
* one for the API listening on http://localhost:3001 | ||
* the second one for the demo UI listening on http://localhost:8080 | ||
|
||
## Run Parsr | ||
Note: a docker volume will be created at first launch so that the data will be kept at containers restart. | ||
|
||
In the root of the repository, launch: | ||
|
||
## Build Parsr | ||
|
||
If you want to build parsr by yourself, at the root of the project, launch: | ||
|
||
``` | ||
docker-compose up | ||
docker-compose -f docker-compose-build.yml build | ||
``` | ||
|
||
Note: A docker volume will be created at first launch so that the data will be kept at containers restart. | ||
This will build Parsr, along with its dependencies. |