fix: 更新依赖包安装方式
Gitea Action for docker build / build-app (push) Successful in 1m20s Details
Gitea Action for docker build runtime / build-runtime (push) Failing after 1m7s Details

This commit is contained in:
chenwj113 2024-06-11 16:59:21 +08:00
parent 59d4f098ea
commit 2ee8beb276
5 changed files with 1805 additions and 28 deletions

View File

@ -5,6 +5,8 @@ on:
branches: [master]
paths:
- 'requirements.txt'
- 'poetry.lock'
- 'pyproject.toml'
- 'RuntimeDockerfile'
jobs:

View File

@ -5,16 +5,22 @@ RUN mkdir /install
WORKDIR /install
COPY requirements.txt .
# COPY requirements.txt .
COPY poetry.lock .
COPY pyproject.toml .
RUN sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list.d/debian.sources
# RUN sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list.d/debian.sources
RUN apt-get update \
&& apt-get install gcc -y \
&& apt-get clean
# RUN apt-get update \
# && apt-get install gcc -y \
# && apt-get clean
RUN pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --prefix=/install
# RUN pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --prefix=/install
RUN pip install -r poetry -i https://mirrors.aliyun.com/pypi/simple/
RUN poetry source add --priority=primary mirrors https://pypi.tuna.tsinghua.edu.cn/simple/
RUN poetry install -C /install
# 应用启动
FROM python:3.11-slim

1766
poetry.lock generated Normal file

File diff suppressed because it is too large Load Diff

25
pyproject.toml Normal file
View File

@ -0,0 +1,25 @@
[tool.poetry]
name = "fastapi-app-template"
version = "0.1.0"
description = ""
authors = ["chenwj113 <chenwj113@gmail.com>"]
license = "MIT"
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
fastapi = "0.111.0"
sqlalchemy = "2.0.0"
aioredis = "2.0.1"
aiomysql = "0.1.1"
fastapi-plugins = "0.13.0"
[[tool.poetry.source]]
name = "mirrors"
url = "https://pypi.tuna.tsinghua.edu.cn/simple/"
priority = "primary"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

View File

@ -1,22 +0,0 @@
# coding: utf-8
from sqlalchemy import Column, DateTime, Integer, text
from sqlalchemy.dialects.mysql import VARCHAR
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
metadata = Base.metadata
class DevicesPlace(Base):
__tablename__ = 'devices_place'
__table_args__ = {'comment': '设备:地址表'}
id = Column(Integer, primary_key=True)
mid = Column(VARCHAR(10), nullable=False, index=True, comment='设备管理ID')
customer_account = Column(VARCHAR(12), nullable=False, index=True, comment='甲方')
region_id = Column(Integer, nullable=False, server_default=text("'0'"), comment='区域id')
building_id = Column(Integer, nullable=False, server_default=text("'0'"), comment='所在楼建筑的id0为待定')
floor = Column(Integer, nullable=False, server_default=text("'0'"), comment='楼层0为待定可为负数')
place = Column(VARCHAR(50), comment='位置(通常是房间号)')
ctime = Column(DateTime, nullable=False, index=True, server_default=text("CURRENT_TIMESTAMP"), comment='记录创建时间')
utime = Column(DateTime, nullable=False, index=True, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"), comment='记录更新时间')