diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..0be726b0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +**/* +!supervisor/**/* +!proto/**/* diff --git a/portal/docker-compose.yaml b/portal/docker-compose.yaml index 73d9d52c..65cac6cb 100644 --- a/portal/docker-compose.yaml +++ b/portal/docker-compose.yaml @@ -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: @@ -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: diff --git a/supervisor/Dockerfile b/supervisor/Dockerfile new file mode 100644 index 00000000..18f238d3 --- /dev/null +++ b/supervisor/Dockerfile @@ -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 diff --git a/supervisor/docker-compose.yaml b/supervisor/docker-compose.yaml new file mode 100644 index 00000000..b31a17b6 --- /dev/null +++ b/supervisor/docker-compose.yaml @@ -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