Skip to content
This repository has been archived by the owner on Jan 9, 2020. It is now read-only.

Commit

Permalink
update makefiles. makefile for web points to right direction for the …
Browse files Browse the repository at this point in the history
…docker container. makefiles specify GOPATH. added keycloak's base image dockerfile
  • Loading branch information
mtbarta committed Oct 28, 2018
1 parent 8f42940 commit 4b72741
Show file tree
Hide file tree
Showing 25 changed files with 503 additions and 68 deletions.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -9,5 +9,5 @@ build:
containers:
cd services/notes && $(MAKE) container
cd services/gateway && $(MAKE) container
cd services/frontend && $(MAKE) container
cd servioces/keycloak && $(MAKE) container
cd web && $(MAKE) container
cd services/keycloak && $(MAKE) container
112 changes: 58 additions & 54 deletions pkg/notes/notes.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions services/elasticsearch/Makefile
Expand Up @@ -4,8 +4,6 @@ MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MAKEFILE_PATH))))
PARENT_DIR="$(dirname "$(CURRENT_DIR)")"

#make sure GOBIN and GOPATH are set!

default: container
container:
docker build -t monocorpus/$(CURRENT_DIR):$(VERSION) -f Dockerfile .
docker build -t monocorpus/$(CURRENT_DIR):$(VERSION) -f Dockerfile .
3 changes: 2 additions & 1 deletion services/gateway/Makefile
Expand Up @@ -3,6 +3,7 @@ VERSION?=latest
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MAKEFILE_PATH))))
PARENT_DIR="$(dirname "$(CURRENT_DIR)")"
GOPATH:=$(shell go env GOPATH)

#make sure GOBIN and GOPATH are set!

Expand All @@ -14,4 +15,4 @@ build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go install -a -installsuffix cgo -ldflags '-w -s' gateway.go

container:
docker build -t $(CURRENT_DIR):$(VERSION) -f Dockerfile $(GOPATH)/src
docker build -t $(CURRENT_DIR):$(VERSION) -f Dockerfile $(GOPATH)/src
5 changes: 2 additions & 3 deletions services/keycloak/Makefile
Expand Up @@ -4,12 +4,11 @@ MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MAKEFILE_PATH))))
PARENT_DIR="$(dirname "$(CURRENT_DIR)")"

#make sure GOBIN and GOPATH are set!

default: build

build: ;
#pass

container:
docker build -t $(CURRENT_DIR):$(VERSION) .
docker build -t jboss/keycloak-postgres:4.0.0.Beta1 -f ./base/Dockerfile ./base
docker build -t $(CURRENT_DIR):$(VERSION) .
40 changes: 40 additions & 0 deletions services/keycloak/base/Dockerfile
@@ -0,0 +1,40 @@
FROM jboss/base-jdk:8

ENV KEYCLOAK_VERSION 4.0.0.Beta1
# Enables signals getting passed from startup script to JVM
# ensuring clean shutdown when container is stopped.
ENV LAUNCH_JBOSS_IN_BACKGROUND 1
ENV PROXY_ADDRESS_FORWARDING false
USER root

RUN yum install -y epel-release && yum install -y jq && yum clean all

USER jboss

RUN cd /opt/jboss/ && curl -L https://downloads.jboss.org/keycloak/$KEYCLOAK_VERSION/keycloak-$KEYCLOAK_VERSION.tar.gz | tar zx && mv /opt/jboss/keycloak-$KEYCLOAK_VERSION /opt/jboss/keycloak

ADD docker-entrypoint.sh /opt/jboss/

ADD cli /opt/jboss/keycloak/cli
RUN cd /opt/jboss/keycloak && bin/jboss-cli.sh --file=cli/standalone-configuration.cli && rm -rf /opt/jboss/keycloak/standalone/configuration/standalone_xml_history
RUN cd /opt/jboss/keycloak && bin/jboss-cli.sh --file=cli/standalone-ha-configuration.cli && rm -rf /opt/jboss/keycloak/standalone/configuration/standalone_xml_history

ENV JDBC_POSTGRES_VERSION 42.1.4
ENV JDBC_MYSQL_VERSION 5.1.18

ADD databases/change-database.sh /opt/jboss/keycloak/bin/change-database.sh

RUN mkdir -p /opt/jboss/keycloak/modules/system/layers/base/com/mysql/jdbc/main; cd /opt/jboss/keycloak/modules/system/layers/base/com/mysql/jdbc/main && curl -O http://central.maven.org/maven2/mysql/mysql-connector-java/$JDBC_MYSQL_VERSION/mysql-connector-java-$JDBC_MYSQL_VERSION.jar
ADD databases/mysql/module.xml /opt/jboss/keycloak/modules/system/layers/base/com/mysql/jdbc/main/module.xml

RUN mkdir -p /opt/jboss/keycloak/modules/system/layers/base/org/postgresql/jdbc/main; cd /opt/jboss/keycloak/modules/system/layers/base/org/postgresql/jdbc/main; curl -L http://central.maven.org/maven2/org/postgresql/postgresql/$JDBC_POSTGRES_VERSION/postgresql-$JDBC_POSTGRES_VERSION.jar > postgres-jdbc.jar
ADD databases/postgres/module.xml /opt/jboss/keycloak/modules/system/layers/base/org/postgresql/jdbc/main

ENV JBOSS_HOME /opt/jboss/keycloak
ENV LANG en_US.UTF-8

EXPOSE 8080

ENTRYPOINT [ "/opt/jboss/docker-entrypoint.sh" ]

CMD ["-b", "0.0.0.0"]

0 comments on commit 4b72741

Please sign in to comment.