forked from steffmartin/condominio
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Atualiza Dockerfile e docker-compose.yml
- Loading branch information
Showing
2 changed files
with
52 additions
and
13 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,10 +1,10 @@ | ||
FROM maven:3.5.2-jdk-8-alpine AS MAVEN_BUILD | ||
FROM maven:3.6.3-openjdk-15-slim AS MAVEN_BUILD | ||
COPY pom.xml /build/ | ||
COPY src /build/src/ | ||
WORKDIR /build/ | ||
RUN mvn package -DskipTests | ||
|
||
FROM openjdk:8-alpine | ||
FROM openjdk:15-alpine | ||
EXPOSE 8080 | ||
COPY --from=MAVEN_BUILD /build/target/*.jar app.jar | ||
ENTRYPOINT ["java","-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 |
---|---|---|
@@ -1,18 +1,57 @@ | ||
version: '3.3' | ||
|
||
services: | ||
app: | ||
image: 'borelanjo/condominio:0.0.1-SNAPSHOT' | ||
|
||
############################################################# | ||
######################### DATABASES ######################### | ||
############################################################# | ||
|
||
db-condominio: | ||
image: 'mysql' | ||
command: ["--log_bin_trust_function_creators=1"] | ||
restart: always | ||
networks: | ||
- spring-boot-mysql-network | ||
- condominio-network | ||
environment: | ||
MYSQL_DATABASE: 'db-condominio' | ||
# So you don't have to use root, but you can if you like | ||
MYSQL_USER: 'condominio' | ||
# You can use whatever password you like | ||
MYSQL_PASSWORD: 'hn+YgnVb9e=aXLmG' | ||
# Password for root access | ||
MYSQL_ROOT_PASSWORD: 'TN^8mE47TRn87f_4' | ||
volumes: | ||
- data-mysql-db:/var/lib/mysql | ||
ports: | ||
- "3306:3306" | ||
|
||
|
||
############################################################# | ||
######################### APP ############################### | ||
############################################################# | ||
|
||
condominio-app: | ||
image: 'borelanjo/condominio:1.0.0' | ||
networks: | ||
- condominio-network | ||
ports: | ||
- "8080:8080" | ||
depends_on: | ||
- db | ||
- db-condominio | ||
environment: | ||
SPRING_DATASOURCE_URL: jdbc:mysql://db:3306/condominio?createDatabaseIfNotExist=true&useSSL=false&allowPublicKeyRetrieval=true | ||
SPRING_DATASOURCE_USERNAME: root | ||
SPRING_DATASOURCE_PASSWORD: root | ||
SPRING_DATASOURCE_URL: jdbc:mysql://db-condominio:3306/db-condominio?createDatabaseIfNotExist=true&useSSL=false&allowPublicKeyRetrieval=true | ||
SPRING_DATASOURCE_USERNAME: condominio | ||
SPRING_DATASOURCE_PASSWORD: hn+YgnVb9e=aXLmG | ||
|
||
db: | ||
image: 'mysql' | ||
networks: | ||
- spring-boot-mysql-network | ||
############################################################# | ||
######################### NETWORK ########################### | ||
############################################################# | ||
networks: | ||
condominio-network: | ||
driver: "bridge" | ||
|
||
############################################################# | ||
######################### VOLUME ############################ | ||
############################################################# | ||
volumes: | ||
data-mysql-db: |