Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO NOT MERGE: supervisorをdockerで動かしてみる #90

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/*
!supervisor/**/*
!proto/**/*
29 changes: 25 additions & 4 deletions portal/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ services:
DATABASE_PASSWORD: dbpass
REDIS_URL: 'redis://redis:6379'
ISUXPORTAL_TIMING_REGISTRATION_OPEN: '2021-06-01T09:00:00Z'
ISUXPORTAL_TIMING_REGISTRATION_CLOSE: '2021-06-31T09:00:00Z'
ISUXPORTAL_TIMING_REGISTRATION_INVITATION_CLOSE: '2021-06-31T09:00:00Z'
ISUXPORTAL_TIMING_REGISTRATION_UPDATE_CLOSE: '2021-06-31T09:00:00Z'
ISUXPORTAL_TIMING_CONTEST_START: '2021-07-14T09:00:00Z'
ISUXPORTAL_TIMING_REGISTRATION_CLOSE: '2021-07-01T09:00:00Z'
ISUXPORTAL_TIMING_REGISTRATION_INVITATION_CLOSE: '2021-07-31T09:00:00Z'
ISUXPORTAL_TIMING_REGISTRATION_UPDATE_CLOSE: '2021-07-31T09:00:00Z'
ISUXPORTAL_TIMING_CONTEST_START: '2021-07-01T09:00:00Z'
ISUXPORTAL_TIMING_CONTEST_FREEZE: '2021-07-14T18:00:00Z'
ISUXPORTAL_TIMING_CONTEST_END: '2021-07-14T19:00:00Z'
ISUXPORTAL_GITHUB_CLIENT_ID:
Expand All @@ -35,6 +35,27 @@ services:
ports:
- '3000:3000'

appgrpc:
build: .
command: 'bundle exec rails runner "Griffin::Server.run(port: 4000)"'
environment:
RACK_ENV: development
RAILS_ENV: development
DATABASE_URL: 'mysql2://isuxportal_dev@mysql/isuxportal_dev?encoding=utf8mb4&charset=utf8mb4&collation=utf8mb4_general_ci'
DATABASE_PASSWORD: dbpass
REDIS_URL: 'redis://redis:6379'
ISUXPORTAL_TIMING_REGISTRATION_OPEN: '2021-06-01T09:00:00Z'
ISUXPORTAL_TIMING_REGISTRATION_CLOSE: '2021-07-01T09:00:00Z'
ISUXPORTAL_TIMING_REGISTRATION_INVITATION_CLOSE: '2021-07-31T09:00:00Z'
ISUXPORTAL_TIMING_REGISTRATION_UPDATE_CLOSE: '2021-07-31T09:00:00Z'
ISUXPORTAL_TIMING_CONTEST_START: '2021-07-01T09:00:00Z'
ISUXPORTAL_TIMING_CONTEST_FREEZE: '2021-07-14T18:00:00Z'
ISUXPORTAL_TIMING_CONTEST_END: '2021-07-14T19:00:00Z'
ISUXPORTAL_ADMIN_LOGIN: admin
ISUXPORTAL_ADMIN_PASSWORD: pass
ports:
- '4000:4000'

redis:
image: redis:latest
expose:
Expand Down
12 changes: 12 additions & 0 deletions supervisor/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM rust:1.53

RUN rustup component add rustfmt

WORKDIR /app

COPY ./supervisor /app
COPY ./proto /proto

RUN cargo install --path . --bin isuxportal-supervisor

CMD isuxportal-supervisor cat
21 changes: 21 additions & 0 deletions supervisor/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '3'

services:
supervisor:
build:
dockerfile: supervisor/Dockerfile
context: ../
networks:
- portal_default
environment:
ISUXPORTAL_SUPERVISOR_ENDPOINT_URL: 'http://appgrpc:4000'
ISUXPORTAL_SUPERVISOR_TOKEN: token
ISUXPORTAL_SUPERVISOR_TEAM_ID: 1
ISUXPORTAL_SUPERVISOR_INSTANCE_NAME: hoge
ISUXPORTAL_SUPERVISOR_HARD_TIMEOUT: 70
ISUXPORTAL_SUPERVISOR_LOG_DIRECTORY: /var/log/isuxportal-supervisor
ISUXPORTAL_SUPERVISOR_INTERVAL_AFTER_EMPTY_RECEIVE: 2

networks:
portal_default:
external: true