Skip to content

Commit

Permalink
add cloudflare staging
Browse files Browse the repository at this point in the history
  • Loading branch information
大浦 翼 committed May 25, 2023
1 parent bab1dbf commit 997c327
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 57 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@

# Ignore master key for decrypting credentials and more.
/api/config/master.key
/api/config/credentials.yml.enc
/admin_api/config/master.key
/admin_api/config/credentials.yml.enc

# Created by .ignore support plugin (hsz.mobi)
### Node template
Expand Down
1 change: 1 addition & 0 deletions api/config/credentials.yml.enc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sFsl9fR3AEekpRovJXVyP/GPFHEbVWYUY0L0l8+AWfnZ18/6qjCgUPxkf9FNoHM2SOtUoxeQh+QIk/+9zcGrlWZX5ZbHsjEnhODuc3xw7TQyCpykZRYsMUgcH496WzNJWc/ZY3sKVdg/u2S3On9SQQEbkcM7FfhkbV3+jiPbKFejaVzh6/o0qfX9aCFbjt1fPNHvJlBpWsODjxG74YgXtrolLE+PAim68haPqg/dDwUORBTlu22I5kKETJ0pDxOTTyQrlPoCw5Lk9qhPWtxYuJQ0cNz+E2wlbk5ZE4289SBYTHmwjCEZ9Lc14Ab/eU0RR2TyMKjZhlTETBYpGaT4u5VS2SXgXgco+chb1mrUS1g7X8ZRUcbVHgc0qEmbCVa5BJmoRGZ0ttBOnVCK56MuYVNuN1KlhTTsIl1D--jy+YyYcILOfZzJI9--iPzdBQ+/U3+uR+IxXgPZTw==
8 changes: 4 additions & 4 deletions cloudflare/stage/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ credentials-file: /home/nonroot/.cloudflared/7c8b780f-8330-4419-b24c-8f81f825528
protocol: http2

ingress:
- hostname: group-manager.stg.nutfes.net
service: http://web:8080
- hostname: group-manager-admin.stg.nutfes.net
- hostname: stg-group-manager.nutfes.net
service: http://user_front:3000
- hostname: stg-group-manager-admin.nutfes.net
service: http://admin_view:8000
- hostname: group-manager-api.stg.nutfes.net
- hostname: stg-group-manager-api.nutfes.net
service: http://api:3000
- service: http_status:404
86 changes: 36 additions & 50 deletions docker-compose.stage.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,50 @@
version: "3"
services:
db:
image: mysql:8.0
container_name: 'GM2-DB'
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_ROOT_USER: root
MYSQL_USER: group-manager-2 # テスト的にユーザーを作ってみる
MYSQL_PASSWORD: password
command: --default-authentication-plugin=mysql_native_password
ports: ["3306:3306"]
volumes: [mysql-data:/var/lib/mysql]

cloudflare:
image: cloudflare/cloudflared
container_name: "GM2-CLOUDFLARE"
volumes: [./cloudflare/stage:/home/nonroot/.cloudflared]
command: tunnel run

api:
build: ./api
command: bash -c "bundle exec rails s"
container_name: "GM2-API"
volumes:
- ./api:/myapp
ports:
- "3000:3000"
stdin_open: true
tty: true
environment:
- RAILS_ENV=production
- RAILS_LOG_TO_STDOUT=ON
env_file:
- nutmeg-mysql.env
- webhook.env
volumes: [./api:/myapp]
ports: ["3000:3000"]
env_file: [group-manager-2.stg.env]

view: # build only
build: ./view
container_name: "GM2-VIEW"
volumes:
- ./view:/app
environment:
- VUE_APP_URL=https://group-manager-api.nutfes.net
user_front:
build: ./user_front
container_name: "GM2-USER-FRONT"
ports:
- "8002:3000"
- "24678:24678"
command: npm run start
volumes: [./user_front:/app]
env_file: [group-manager-2.stg.env]
depends_on: [api]

admin_view:
build: ./admin_view
container_name: "GM2-ADMIN-VIEW"
ports:
- "8000:8000"
command: sh -c "npm run start"
volumes:
- ./admin_view:/app
tty: true
environment:
- VUE_APP_URL=https://group-manager-api.nutfes.net

web:
image: nginx:1.17
container_name: "GM2-WEB"
volumes:
- ./web/nginx.conf:/etc/nginx/conf.d/default.conf
- ./inside_view/vue-project/dist:/var/www/vhosts/group-manager-inside.nutfes.net
- ./view/vue-project/dist:/var/www/vhosts/group-manager.nutfes.net
ports:
- "8080:8080"
- "8888:8888"
depends_on:
- admin_view
- api

cloudflare:
image: cloudflare/cloudflared
container_name: "GM2-CLOUDFLARE"
volumes:
- ./cloudflare/stage:/home/nonroot/.cloudflared
command: tunnel run
ports: ["8000:8000"]
command: npm run start
volumes: [./admin_view:/app]
env_file: [group-manager-2.stg.env]

volumes:
mysql-data:
driver: local
code_share:
driver: local

0 comments on commit 997c327

Please sign in to comment.