-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from filiperochalopes/develop
Simplificando repo
- Loading branch information
Showing
13 changed files
with
197 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
POSTGRES_DB='esus' | ||
POSTGRES_USER='postgres' | ||
POSTGRES_PASSWORD='esus' | ||
POSTGRESQL_PORT=5434 | ||
POSTGRESQL_PORT=54351 | ||
APP_PORT=88 | ||
PGWEB_PORT=8097 | ||
PGWEB_PORT=8099 | ||
TIMEZONE='America/Bahia' |
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,2 +1,6 @@ | ||
data | ||
*.jar | ||
*.jar | ||
__pycache__ | ||
*.pyc | ||
*.backup | ||
.webassets-cache |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
prod-run: | ||
docker-compose down --remove-orphans --volumes | ||
sudo chmod -R 777 data | ||
docker-compose up -d | ||
prod-update: | ||
docker-compose down --remove-orphans --volumes | ||
sudo chmod -R 777 data | ||
docker-compose up -d --build | ||
dev-run: | ||
docker-compose -f docker-compose.dev.yml down --remove-orphans --volumes | ||
sudo chmod -R 777 data | ||
docker-compose -f docker-compose.dev.yml up -d | ||
dev-down: | ||
docker-compose -f docker-compose.dev.yml down --remove-orphans --volumes | ||
dev-logs: | ||
docker-compose -f docker-compose.dev.yml logs -f | ||
dev-update: | ||
docker-compose -f docker-compose.dev.yml down --remove-orphans --volumes | ||
sudo chmod -R 777 data | ||
docker-compose -f docker-compose.dev.yml up -d --build | ||
terminal: | ||
docker exec -it esus_app bash | ||
db-terminal: | ||
docker exec -it esus_psql bash |
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
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,45 @@ | ||
version: "3" | ||
services: | ||
psql: | ||
container_name: esus_psql | ||
restart: always | ||
image: postgres:13.5 | ||
volumes: | ||
- ./data/psql_db:/var/lib/postgresql/data | ||
- ./data/backups:/home | ||
environment: | ||
- POSTGRES_DB=${POSTGRES_DB} | ||
- POSTGRES_USER=${POSTGRES_USER} | ||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD} | ||
ports: | ||
- "${POSTGRESQL_PORT}:5432" | ||
pgweb: | ||
container_name: esus_pgweb | ||
restart: always | ||
image: sosedoff/pgweb | ||
ports: | ||
- "${PGWEB_PORT}:8081" | ||
environment: | ||
- DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@psql:5432/${POSTGRES_DB}?sslmode=disable | ||
depends_on: | ||
- psql | ||
app: | ||
container_name: esus_app | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
args: | ||
- POSTGRES_DATABASE=${POSTGRES_DB} | ||
- POSTGRES_USERNAME=${POSTGRES_USER} | ||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD} | ||
- TIMEZONE=${TIMEZONE} | ||
stdin_open: true | ||
tty: true | ||
volumes: | ||
- ./install.sh:/var/www/html/install.sh | ||
- ./run.sh:/var/www/html/run.sh | ||
- ./data/e-SUS:/opt/e-SUS | ||
ports: | ||
- "${APP_PORT}:8080" | ||
depends_on: | ||
- psql |
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 was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
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,5 +1,5 @@ | ||
cd /var/www/html | ||
|
||
systemctl status e-SUS-PEC | ||
echo "Instalando pacotes java" | ||
|
||
java -jar ${JAR_FILENAME} -console -url="jdbc:postgresql://psql:5432/${POSTGRES_DATABASE}" -username ${POSTGRES_USERNAME} -password ${POSTGRES_PASSWORD} |
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,5 +1,31 @@ | ||
#!/bin/sh | ||
chmod +x /opt/e-SUS/webserver/standalone.sh | ||
ss -tl | ||
nohup bash -c "sh /opt/e-SUS/webserver/standalone.sh &" && sleep 4 | ||
ss -tl | ||
|
||
echo "Inicializando configuração de data e hora..." | ||
ntpd -gq | ||
service ntp start | ||
|
||
echo "Ajustando data para $TIMEZONE ..." | ||
echo $TIMEZONE > /etc/timezone && \ | ||
ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime && \ | ||
dpkg-reconfigure -f noninteractive tzdata | ||
|
||
echo "Inicializando sistema..." | ||
FILE=/opt/e-SUS/webserver/standalone.sh | ||
|
||
if test -f "$FILE"; then | ||
echo "$FILE existe. Executando entrypoint do eSUS-PEC" | ||
if ss -tulpn | grep 8080 > /dev/null ; then | ||
echo "Já tem uma aplicação rodando na porta 8080, mantendo terminal aberto." | ||
else | ||
echo "Nada rodando em 8080, executando entrada..." | ||
chmod +x /opt/e-SUS/webserver/standalone.sh | ||
nohup /opt/e-SUS/webserver/standalone.sh & tail -f nohup.out | ||
fi | ||
else | ||
printf "$FILE não existe, execute manualmente o sistema com\n \ | ||
sh /opt/e-SUS/webserver/standalone.sh\n\n \ | ||
ou instale o sitema primeiro, caso seja a primeira vez instalando:\n\n | ||
sh /install.sh" | ||
fi | ||
|
||
/bin/bash |