Update run.sh
Co-authored-by: Ezequiel Bellver <ebellver@itba.edu.ar> Co-authored-by: Juan Barmasch <jbarmasch@itba.edu.ar>
This commit is contained in:
parent
958d658693
commit
36b830db42
|
@ -69,4 +69,5 @@ cython_debug/
|
|||
.vscode/*
|
||||
*.obj
|
||||
*_data
|
||||
data/
|
||||
test.py
|
||||
|
|
|
@ -11,9 +11,9 @@ services:
|
|||
ports:
|
||||
- "27017:27017"
|
||||
volumes:
|
||||
- ./mongo_data/db:/data/db
|
||||
- ./mongo_data/dev.archive:/Databases/dev.archive
|
||||
- ./mongo_data/production:/Databases/production
|
||||
- ./data/mongo/db:/data/db
|
||||
- ./data/mongo/dev.archive:/Databases/dev.archive
|
||||
- ./data/mongo/production:/Databases/production
|
||||
|
||||
postgres:
|
||||
image: postgres
|
||||
|
@ -25,7 +25,7 @@ services:
|
|||
POSTGRES_PASSWORD: password
|
||||
POSTGRES_DB: bd2
|
||||
volumes:
|
||||
- ./postgres_data:/var/lib/postgresql/data
|
||||
- ./data/postgres:/var/lib/postgresql/data
|
||||
|
||||
elasticsearch:
|
||||
image: docker.elastic.co/elasticsearch/elasticsearch:8.4.2
|
||||
|
@ -35,7 +35,7 @@ services:
|
|||
- discovery.type=single-node
|
||||
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
|
||||
volumes:
|
||||
- ./elasticsearch_data:/usr/share/elasticsearch/data
|
||||
- ./data/elasticsearch:/usr/share/elasticsearch/data
|
||||
ports:
|
||||
- "9200:9200"
|
||||
- "9300:9300"
|
||||
|
|
16
run.sh
16
run.sh
|
@ -4,9 +4,10 @@ usage() {
|
|||
cat <<EOF
|
||||
usage: ${0##*/} [command]
|
||||
-h Print this help message.
|
||||
-a Run API.
|
||||
-i Install.
|
||||
-d Run docker-compose.
|
||||
-a Run API on host 0.0.0.0:8000.
|
||||
-i Install dependencies.
|
||||
-d Run docker-compose up.
|
||||
-c Configure databases.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
@ -17,7 +18,7 @@ while getopts "hadic" OPTION; do
|
|||
a) RUN=api ;;
|
||||
d) RUN=docker ;;
|
||||
i) RUN=install ;;
|
||||
c) RUN=configure;;
|
||||
c) RUN=configure ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
done
|
||||
|
@ -30,8 +31,9 @@ elif [ "$RUN" = 'api' ]; then
|
|||
elif [ "$RUN" = 'configure' ]; then
|
||||
poetry run configure
|
||||
else
|
||||
[ ! -d postgres_data ] && mkdir postgres_data
|
||||
[ ! -d mongo_data ] && mkdir mongo_data
|
||||
[ ! -d elasticsearch_data ] && mkdir elasticsearch_data
|
||||
[ ! -d data ] && mkdir data
|
||||
[ ! -d data/postgres ] && mkdir data/postgres
|
||||
[ ! -d data/mongo ] && mkdir data/mongo
|
||||
[ ! -d data/elasticsearch ] && mkdir data/elasticsearch
|
||||
docker-compose up
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue