-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configurando o docker-compose e dockerfile para o projeto..
- Loading branch information
1 parent
1e823a9
commit 526aa12
Showing
3 changed files
with
85 additions
and
15 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM java:8 | ||
VOLUME /tmp | ||
# Copia o .jar para dentro do container | ||
ADD ./target/casafacilimoveis-0.0.1-SNAPSHOT.jar app.jar | ||
# Expõe a porta 8080 | ||
EXPOSE 8080 | ||
# Executa | ||
RUN bash -c 'touch /app.jar' | ||
# Passa os comandos para o docker logo quando subir | ||
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] |
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,61 @@ | ||
version: '3.4' | ||
services: | ||
# Cria o banco de dados | ||
db-postgres-compose: | ||
image: postgres:10 | ||
restart: always | ||
# Variaveis de ambiente | ||
environment: | ||
POSTGRES_PASSWORD: "Postgres2019!" | ||
# Porta exposta | ||
ports: | ||
- "15432:5432" | ||
# Mapeamento do volume de dados | ||
volumes: | ||
- ../../Database:/var/lib/postgresql/data | ||
# Rede | ||
networks: | ||
- casa-facil-network | ||
# Cria a interface do PGAdmin 4 | ||
db-pgadmin-compose: | ||
image: dpage/pgadmin4 | ||
restart: always | ||
# Variaveis de ambiente | ||
environment: | ||
PGADMIN_DEFAULT_EMAIL: "[email protected]" | ||
PGADMIN_DEFAULT_PASSWORD: "PgAdmin2019!" | ||
# Porta Exposta | ||
ports: | ||
- "16543:80" | ||
# Dependências | ||
depends_on: | ||
- db-postgres-compose | ||
# Rede | ||
networks: | ||
- casa-facil-network | ||
# Cria o projeto do back-end | ||
spring-boot-compose: | ||
image: spring-boot-compose | ||
restart: always | ||
# Parâmetros de build | ||
build: | ||
# Contexto da aplicação | ||
context: . | ||
# Localização do dockerfile | ||
dockerfile: ./Dockerfile | ||
# Diretório do projeto | ||
working_dir: / | ||
# Porta exposta | ||
ports: | ||
- "8080:8080" | ||
# Comando para executar na inicialização | ||
command: mvn spring-boot:run | ||
# Depêndencias | ||
depends_on: | ||
- db-postgres-compose | ||
# Rede | ||
networks: | ||
- casa-facil-network | ||
networks: | ||
casa-facil-network: | ||
driver: bridge |
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