diff --git a/TASKS.md b/TASKS.md new file mode 100644 index 0000000..68def3b --- /dev/null +++ b/TASKS.md @@ -0,0 +1,9 @@ +# Hour 1 +- [x] (2pt) Create a dockerfile for each projects in `settings.gradle` +- [ ] (1pt) Create a gradle task to build all docker, the task could look like `./gradlew clean build buildDocker -x test` +- [ ] (0.5pt) Create a gradle task to build single docker images when you are working in only one module +- [ ] (2pt) Create a docker-compose version 3+ file to orchestrate de booting of all modules + +Docker files are done, you can build with `docker build authorization/` for example. I dunno what that does, but it runs. + +I tried the second one, create a gradle task, but I dunno what I'm doing. It's in `build.gradle` \ No newline at end of file diff --git a/authorization/Dockerfile b/authorization/Dockerfile new file mode 100644 index 0000000..290ca17 --- /dev/null +++ b/authorization/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine:3.7 +EXPOSE 6379 +ENV REDIS_VERSION=4.0.8 diff --git a/build.gradle b/build.gradle index 3b319c2..00b0cab 100644 --- a/build.gradle +++ b/build.gradle @@ -42,4 +42,19 @@ subprojects { maven { url 'https://repo.spring.io/libs-snapshot' } } +} + + +def buildDockers = { + exec { + commandLine "docker", "build", "authorization/" + commandLine "docker", "build", "communication/" + commandLine "docker", "build", "config-server/" + commandLine "docker", "build", "eureka-server/" + commandLine "docker", "build", "zuul-server/" + } +} + +task buildDocker(type: Exec) { + buildDockers() } \ No newline at end of file diff --git a/communication/Dockerfile b/communication/Dockerfile new file mode 100644 index 0000000..290ca17 --- /dev/null +++ b/communication/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine:3.7 +EXPOSE 6379 +ENV REDIS_VERSION=4.0.8 diff --git a/config-server/Dockerfile b/config-server/Dockerfile new file mode 100644 index 0000000..290ca17 --- /dev/null +++ b/config-server/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine:3.7 +EXPOSE 6379 +ENV REDIS_VERSION=4.0.8 diff --git a/eureka-server/Dockerfile b/eureka-server/Dockerfile new file mode 100644 index 0000000..290ca17 --- /dev/null +++ b/eureka-server/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine:3.7 +EXPOSE 6379 +ENV REDIS_VERSION=4.0.8 diff --git a/zuul-server/Dockerfile b/zuul-server/Dockerfile new file mode 100644 index 0000000..290ca17 --- /dev/null +++ b/zuul-server/Dockerfile @@ -0,0 +1,3 @@ +FROM alpine:3.7 +EXPOSE 6379 +ENV REDIS_VERSION=4.0.8