Skip to content

youngeek-0410/cloveeee-python

Repository files navigation

[サービス名]

Overview

[サービス名] is a service that provides [機能]. This service was developed for HackU Kosen 2022.

Prerequisites

Poetry

Dependency management for Python files is done using POETRY.

  1. https://python-poetry.org/docs/#installation
  2. python -m venv venv
  3. source venv/bin/activate
  4. pip install --upgrade pip (if needed)
  5. poetry install (After cloning this repository)

pre-commit (for developers)

This tool defines commands to be executed before committing. It is already defined in .pre-commit-config.yaml, so you need to configure it in your environment. Please follow the steps below.

  1. https://pre-commit.com/#installation
  2. pre-commit install (After cloning this repository)

Usage

  1. Clone this repository

  2. Create fastapi.env with reference to fastapi.env.tmpl

  3. Start Server

    docker-compose up

Additional commands

  • Dependency install

    docker-compose run --rm fastapi poetry install
  • Setup Static Files

    docker-compose run --rm fastapi poetry run python manage.py collectstatic --noinput
  • Migrate

    docker-compose run --rm fastapi poetry run python manage.py migrate
  • Create Super User for Admin Page

    docker-compose run --rm fastapi poetry run python manage.py createsuperuser

Alias for frequently used commands

source alias.sh

OpenAPI

https://youngeek-0410.github.io/hacku-kosen-2022-backend/

Deploy to Cloud Run from Local

  1. Build

    IMAGE=[イメージ名] docker-compose -f docker-compose.prod.yaml build
  2. Push to GCR

    IMAGE=[イメージ名] docker-compose -f docker-compose.prod.yaml push
  3. Deploy to Cloud Run

    gcloud run deploy [サービス名(CloudRun)] --image [イメージ名] --project [プロジェクト名] --port 8000 --region asia-northeast1 --platform managed
  4. Set Environment Variables

    gcloud run services update [サービス名(CloudRun)] --set-env-vars [key1]=[value1],[key2]=[value2]

About

Digital Colored Paper Backend for HackU kosen 2022

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •