https://github.com/yuu-eguci/mrrhp-apache
🎨 To create weblog system which works through apache. Articles are posted with markdown style. And this may become a joint development project with mates at once.
https://github.com/yuu-eguci/mrrhp-apache
django docker mysql nextjs nginx pipenv python typescript ubuntu
Last synced: about 1 year ago
JSON representation
🎨 To create weblog system which works through apache. Articles are posted with markdown style. And this may become a joint development project with mates at once.
- Host: GitHub
- URL: https://github.com/yuu-eguci/mrrhp-apache
- Owner: yuu-eguci
- Created: 2019-11-24T12:59:54.000Z (over 6 years ago)
- Default Branch: dev
- Last Pushed: 2025-03-22T03:22:22.000Z (over 1 year ago)
- Last Synced: 2025-04-10T21:19:07.918Z (about 1 year ago)
- Topics: django, docker, mysql, nextjs, nginx, pipenv, python, typescript, ubuntu
- Language: Python
- Homepage:
- Size: 2.03 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Mrrhp Apache
===

## v4
v4 の特徴↓
- Docker
- Pipenv
- Nginx
- MySQL v8
- Ubuntu
```bash
# .env.local を作ったあと、中身を埋めてね
(cd ./docker; cp ./.env.example ./.env.local)
# .env を用意する -> cat で確認
(cd ./docker; cp ./.env.local ./.env)
cat ./docker/.env
# Dockerfile を用意する -> cat で確認
(cd ./docker/django-container; cp ./Dockerfile.local ./Dockerfile)
cat ./docker/django-container/Dockerfile
# Docker コンテナを立ち上げる
# NOTE: Dockerfile が修正された場合に備えて --build
# NOTE: 本番環境では react-service が不要
(cd ./docker; docker compose up -d --build mysql-service django-service react-service)
# NOTE: history 機能を使うために sh ではなく bash を使用
(cd ./docker; docker compose exec django-service bash)
# Check↓
python -V
# --> Python 3.10.14
pipenv --version
# --> pipenv, version 2023.12.1
# PIPENV_VENV_IN_PROJECT の効果で src/.venv が作成される。
# NOTE: 開発環境ではいちいち自分でやりたいんだよね。
pipenv sync --dev
pipenv run python manage.py migrate
# NOTE: デバッグ情報の表示や自動リロード機能が含まれている (ただし gunicorn にも --reload はある)
# gunicorn myproject.wsgi:application --bind 0.0.0.0:8000 は多くのリクエストを効率的に処理できるように設計されている。
pipenv run python manage.py runserver 0.0.0.0:8000
# --> http://localhost:8901/ でアクセス。
# React.js 側。
(cd ./docker; docker compose exec react-service sh)
node --version
# --> v22.2.0
yarn --version
# --> 1.22.19
yarn list react
# --> └─ react@18.3.1
yarn install
yarn dev --host
# --> http://localhost:8902/ でアクセス。
yarn build
yarn preview --host
# --> http://localhost:8903/ でアクセス。
```
### Test
```bash
# Unittesting
time pipenv run python manage.py test --failfast --parallel --settings=config.settings.test
# Lint
pipenv run flake8
# Type check
pipenv run mypy .
```
## v3
v3 は `v3` ブランチでアーカイブ。
https://github.com/yuu-eguci/mrrhp-apache/tree/v3
v3 の特徴↓
- Vagrant
- Apache
- MySQL v5
- CentOS