Skip to content

Commit

Permalink
feat: docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
bookpanda committed Jun 29, 2024
1 parent b289893 commit 3c43d55
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 1 deletion.
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
pull-latest-mac:
docker pull --platform linux/x86_64 ghcr.io/isd-sgcu/rpkm67-gateway:latest
docker pull --platform linux/x86_64 ghcr.io/isd-sgcu/rpkm67-auth:latest
docker pull --platform linux/x86_64 ghcr.io/isd-sgcu/rpkm67-backend:latest
docker pull --platform linux/x86_64 ghcr.io/isd-sgcu/rpkm67-checkin:latest
docker pull --platform linux/x86_64 ghcr.io/isd-sgcu/rpkm67-store:latest

pull-latest-windows:
docker pull ghcr.io/isd-sgcu/rpkm67-gateway:latest
docker pull ghcr.io/isd-sgcu/rpkm67-auth:latest
docker pull ghcr.io/isd-sgcu/rpkm67-backend:latest
docker pull ghcr.io/isd-sgcu/rpkm67-checkin:latest
docker pull ghcr.io/isd-sgcu/rpkm67-store:latest

docker:
docker-compose up

docker-qa:
docker-compose -f docker-compose.qa.yml up

server:
go run cmd/main.go

Expand Down
1 change: 0 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ func main() {
if err != nil {
panic(fmt.Sprintf("Failed to load config: %v", err))
}
fmt.Println("conf: ", conf)

logger := logger.New(conf)

Expand Down
84 changes: 84 additions & 0 deletions docker-compose.qa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
version: "3.9"

services:
gateway:
image: ghcr.io/isd-sgcu/rpkm67-gateway:latest
container_name: gateway
restart: unless-stopped
environment:
APP_PORT: 3001
APP_ENV: development
APP_MAX_FILE_SIZE_MB: 10
CORS_ORIGINS: http://localhost:3000
SERVICE_AUTH: auth:3002
SERVICE_BACKEND: backend:3003
SERVICE_CHECKIN: checkin:3004
SERVICE_STORE: http://localhost:3005
networks:
- rpkm67
ports:
- "3001:3001"

backend:
image: ghcr.io/isd-sgcu/rpkm67-backend:latest
container_name: backend
restart: unless-stopped
environment:
APP_PORT: 3003
APP_ENV: development
DB_URL: postgres://root:1234@db:5432/rpkm67_db
REDIS_HOST: cache
REDIS_PORT: 6379
REDIS_PASSWORD: 5678
PIN_WORKSHOP_CODE: workshop
PIN_WORKSHOP_COUNT: 5
PIN_LANDMARK_CODE: landmark
PIN_LANDMARK_COUNT: 4
networks:
- rpkm67
ports:
- "3003:3003"

checkin:
image: ghcr.io/isd-sgcu/rpkm67-checkin:latest
container_name: checkin
restart: unless-stopped
environment:
APP_PORT: 3004
APP_ENV: development
DB_URL: postgres://root:1234@db:5432/rpkm67_db
networks:
- rpkm67
ports:
- "3004:3004"

db:
image: postgres:15.1-alpine3.17
container_name: db
restart: unless-stopped
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: "1234"
POSTGRES_DB: rpkm67_db
networks:
- rpkm67
volumes:
- ./volumes/postgres:/var/lib/postgresql/data
ports:
- "5432:5432"

cache:
image: redis:7.2.3-alpine
container_name: cache
restart: unless-stopped
environment:
REDIS_HOST: localhost
REDIS_PASSWORD: "5678"
networks:
- rpkm67
ports:
- "6379:6379"

networks:
rpkm67:
name: rpkm67
33 changes: 33 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: "3.9"

services:
db:
image: postgres:15.1-alpine3.17
container_name: db
restart: unless-stopped
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: "1234"
POSTGRES_DB: rpkm67_db
networks:
- rpkm67
volumes:
- ./volumes/postgres:/var/lib/postgresql/data
ports:
- "5432:5432"

cache:
image: redis:7.2.3-alpine
container_name: cache
restart: unless-stopped
environment:
REDIS_HOST: localhost
REDIS_PASSWORD: "5678"
networks:
- rpkm67
ports:
- "6379:6379"

networks:
rpkm67:
name: rpkm67

0 comments on commit 3c43d55

Please sign in to comment.