-
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.
- Loading branch information
1 parent
d2097ff
commit 16c02b7
Showing
7 changed files
with
71 additions
and
78 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,4 +1,16 @@ | ||
# Ignorar archivos y directorios generados por Docker | ||
# Ignorar los archivos de compilación de Scala | ||
target/ | ||
docker-master/init.sql | ||
docker-slave/init.sql | ||
database-scala/target/ | ||
database-scala/project/ | ||
|
||
# Ignorar los archivos de configuración del IDE | ||
.idea/ | ||
*.iml | ||
*.ipr | ||
*.iws | ||
|
||
# Ignorar los archivos de registro | ||
*.log | ||
|
||
# Ignorar los archivos del sistema | ||
.DS_Store |
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,18 @@ | ||
# Usar una imagen base oficial de Scala | ||
FROM hseeberger/scala-sbt:8u222_1.3.5_2.13.1 | ||
|
||
# Definir el directorio de trabajo en el contenedor | ||
WORKDIR /app | ||
|
||
# Copiar los archivos del proyecto al contenedor | ||
COPY . /app | ||
|
||
# Compilar la aplicación | ||
RUN sbt update | ||
RUN sbt compile | ||
|
||
# Exponer el puerto por el que se comunicará la aplicación | ||
EXPOSE 8080 | ||
|
||
# Definir el comando para ejecutar la aplicación | ||
CMD ["sbt", "run"] |
File renamed without changes.
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,24 +1,49 @@ | ||
version: '3' | ||
version: '3.1' | ||
|
||
services: | ||
mariadb-master: | ||
image: mariadb:latest | ||
# Configuración del maestro MariaDB | ||
db-master: | ||
image: mariadb | ||
command: --init-file /docker-entrypoint-initdb.d/init.sql | ||
environment: | ||
MYSQL_ROOT_PASSWORD: mysecretpassword | ||
MYSQL_USER: replication_user | ||
MYSQL_PASSWORD: replication_password | ||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} | ||
MYSQL_DATABASE: ${MYSQL_DATABASE} | ||
MYSQL_USER: ${MYSQL_USER} | ||
MYSQL_PASSWORD: ${MYSQL_PASSWORD} | ||
ports: | ||
- "3306:3306" | ||
volumes: | ||
- ./docker-master/init.sql:/docker-entrypoint-initdb.d/init.sql | ||
- db-master-data:/var/lib/mysql | ||
- ./database:/docker-entrypoint-initdb.d | ||
|
||
mariadb-slave: | ||
image: mariadb:latest | ||
# Configuración del esclavo MariaDB | ||
db-slave: | ||
image: mariadb | ||
command: --init-file /docker-entrypoint-initdb.d/init.sql | ||
environment: | ||
MYSQL_ROOT_PASSWORD: mysecretpassword | ||
MYSQL_USER: replication_user | ||
MYSQL_PASSWORD: replication_password | ||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} | ||
MYSQL_DATABASE: ${MYSQL_DATABASE} | ||
MYSQL_USER: ${MYSQL_USER} | ||
MYSQL_PASSWORD: ${MYSQL_PASSWORD} | ||
depends_on: | ||
- db-master | ||
ports: | ||
- "3307:3306" | ||
volumes: | ||
- ./docker-slave/init.sql:/docker-entrypoint-initdb.d/init.sql | ||
- db-slave-data:/var/lib/mysql | ||
- ./database:/docker-entrypoint-initdb.d | ||
|
||
# Configuración de la aplicación Scala | ||
myproject: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
ports: | ||
- "8080:8080" | ||
depends_on: | ||
- db-master | ||
- db-slave | ||
|
||
volumes: | ||
db-master-data: | ||
db-slave-data: |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.