Skip to content

Commit

Permalink
update docker sim
Browse files Browse the repository at this point in the history
  • Loading branch information
jrapoport committed Jul 6, 2021
1 parent 31faced commit d6f11c9
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 14 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM golang:1.15-alpine as build-stage
FROM golang:alpine as build-stage
ENV GO111MODULE=on
ENV CGO_ENABLED=0

RUN apk add --no-cache make git

Expand Down
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ ifeq ($(COVERAGE),1)
TEST_FLAGS := $(TEST_FLAGS) $(COVERAGE_FLAGS)
endif

COMPOSE_FILE:=docker-compose.yaml

$(GO_LINT):
$(GO_GET) $(GO_LINT_REPO)

Expand Down Expand Up @@ -138,19 +140,23 @@ image: ## Build the Docker image
docker build .

gothic: ## Start gothic
docker-compose -f docker-compose.yaml up -d gothic
docker compose -f $(COMPOSE_FILE) up -d gothic

envoy: ## Start envoy
docker-compose -f docker-compose.yaml up -d envoy
docker compose -f $(COMPOSE_FILE) up -d envoy

mysql: COMPOSE_FILE?=docker-compose-dev.yaml
mysql: ## Start mysql
docker-compose -f docker-compose-dev.yaml up -d mysql
docker compose -f $(COMPOSE_FILE) up -d mysql

pg: COMPOSE_FILE?=docker-compose-dev.yaml
pg: ## Start postgres
docker-compose -f docker-compose-dev.yaml up -d pg
docker compose -f $(COMPOSE_FILE) up -d pg

db: mysql ## Start mysql db

sim: COMPOSE_FILE:=docker-compose.yaml -f docker-compose-dev.yaml
sim: COMPOSE_ENV:=./env/sim.env
sim: db envoy gothic

.PHONY: help fmt vet lint audit static tidy deps rpc test build \
Expand Down
1 change: 1 addition & 0 deletions codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ ignore:
- "test/"
- "cmd/"
- "api/"
- "core/signup_debug.go"
4 changes: 4 additions & 0 deletions docker-compose-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ version: "3.8"

services:

gothic:
depends_on:
- mysql

mysql:
image: mysql:latest
command: --init-file /data/application/init.sql
Expand Down
2 changes: 0 additions & 2 deletions env/dev.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ GOTHIC_JWT_SECRET="secret"

GOTHIC_HOST=localhost

GOTHIC_DB_NAMESPACE=gothic_dev
GOTHIC_DB_AUTOMIGRATE=true

GOTHIC_DB_DRIVER=mysql
GOTHIC_DB_DSN="root@tcp(localhost:3306)/dev?parseTime=true"

Expand Down
8 changes: 4 additions & 4 deletions env/sim.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ GOTHIC_JWT_SECRET="secret"

GOTHIC_HOST=0.0.0.0

GOTHIC_DB_DRIVER=mysql
GOTHIC_DB_DSN="root@tcp(mysql_db:3306)/dev?parseTime=true"
GOTHIC_DB_AUTOMIGRATE=true

GOTHIC_SIGNUP_AUTOCONFIRM=true
GOTHIC_DB_DRIVER=mysql
GOTHIC_DB_DSN="root@tcp(host.docker.internal:3306)/dev?parseTime=true"

GOTHIC_LOG_LEVEL=info

GOTHIC_SIGNUP_AUTOCONFIRM=true
6 changes: 3 additions & 3 deletions env/test.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ GOTHIC_SITE_URL=https://www.example.com
GOTHIC_ROOT_PASSWORD=password
GOTHIC_JWT_SECRET="TEST-SECRET"

GOTHIC_DB_NAMESPACE=test
GOTHIC_DB_AUTOMIGRATE=true

# sqlite
GOTHIC_DB_DRIVER=sqlite
GOTHIC_DB_DSN=build
Expand All @@ -16,6 +19,3 @@ GOTHIC_DB_DSN=build
# GOTHIC_DB_DSN="postgres://root:[email protected]:5432/test"

# GOTHIC_LOG_LEVEL=debug

GOTHIC_DB_NAMESPACE=test
GOTHIC_DB_AUTOMIGRATE=true

0 comments on commit d6f11c9

Please sign in to comment.