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