fix deploy
All checks were successful
Deploy FastAPI Application / deploy (push) Successful in 12s

This commit is contained in:
Zikil 2024-12-15 01:43:03 +07:00
parent 70ecfd8d2f
commit e0d8993aa9
5 changed files with 47 additions and 168 deletions

View File

@ -1,4 +1,4 @@
FROM python:3.10
FROM python:3.10-slim
WORKDIR /code
@ -6,6 +6,6 @@ COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
COPY ./app /code/app
COPY . /code
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8020"]
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8020"]

View File

@ -1,93 +1 @@
# Wanlanda_website
## Getting started
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://cv4227119.regru.cloud/root/wanlanda_website.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](https://cv4227119.regru.cloud/root/wanlanda_website/-/settings/integrations)
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
Wanlanda.ru

11
main.py
View File

@ -5,7 +5,6 @@ from fastapi.templating import Jinja2Templates
from pydantic import BaseModel, EmailStr
from aiogram import Bot, Dispatcher
from fastapi.middleware.wsgi import WSGIMiddleware
import uvicorn
BOT_TOKEN = '7102060229:AAE4SWmgKXkCBC482l8Ble5lKzlCV2YIWnM'
ID = '340394898'
@ -16,8 +15,8 @@ bot = Bot( # Образ Бота
app = FastAPI()
# Для совместимости с WSGI
application = WSGIMiddleware(app)
# # Для совместимости с WSGI
# application = WSGIMiddleware(app)
# Монтирование статических файлов
app.mount("/static", StaticFiles(directory="static"), name="static")
@ -105,6 +104,6 @@ Email: {form_data.email}
)
print(se)
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=20001)
# if __name__ == "__main__":
# import uvicorn
# uvicorn.run(app, host="0.0.0.0", port=20001)

View File

@ -53,4 +53,40 @@ http {
# proxy_set_header X-Forwarded-Proto $scheme;
# }
# }
# }
# }
GNU nano 7.2 /etc/nginx/sites-enabled/sybiko.ru
server {
server_name wanlanda.ru www.wanlanda.ru;
location / {
proxy_pass http://127.0.0.1:8020;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/wanlanda.ru/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/wanlanda.ru/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = wanlanda.ru) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name wanlanda.ru www.wanlanda.ru;
return 404; # managed by Certbot
}

View File

@ -1,108 +1,44 @@
aiofiles==23.2.1
aiogram==3.10.0
aiohttp==3.9.5
aioredis==2.0.1
aiosignal==1.3.1
aiosqlite==0.17.0
annotated-types==0.7.0
anyio==4.4.0
appnope==0.1.4
asttokens==2.4.1
async-timeout==4.0.3
attrs==23.2.0
Babel==2.15.0
bcrypt==4.1.3
beautifulsoup4==4.12.3
bs4==0.0.2
certifi==2024.7.4
cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.7
comm==0.2.2
cryptography==43.0.0
databases==0.9.0
debugpy==1.8.2
decorator==5.1.1
dnspython==2.6.1
ecdsa==0.19.0
email_validator==2.2.0
exceptiongroup==1.2.2
executing==2.0.1
fastapi==0.111.1
fastapi-admin==1.0.4
fastapi-cli==0.0.4
frozenlist==1.4.1
greenlet==3.0.3
h11==0.14.0
httpcore==1.0.5
httptools==0.6.1
httpx==0.27.0
idna==3.7
ipykernel==6.29.5
ipython==8.26.0
iso8601==1.1.0
itsdangerous==2.2.0
jedi==0.19.1
Jinja2==3.1.4
jupyter_client==8.6.2
jupyter_core==5.7.2
magic-filter==1.0.12
markdown-it-py==3.0.0
MarkupSafe==2.1.5
matplotlib-inline==0.1.7
mdurl==0.1.2
multidict==6.0.5
nest-asyncio==1.6.0
numpy==2.0.1
orjson==3.10.6
packaging==24.1
pandas==2.2.2
parso==0.8.4
passlib==1.7.4
pendulum==3.0.0
pexpect==4.9.0
platformdirs==4.2.2
prompt_toolkit==3.0.47
psutil==6.0.0
ptyprocess==0.7.0
pure_eval==0.2.3
pyasn1==0.6.0
pycparser==2.22
pydantic==2.8.2
pydantic-extra-types==2.9.0
pydantic-settings==2.3.4
pydantic_core==2.20.1
Pygments==2.18.0
pypika-tortoise==0.1.6
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
python-jose==3.3.0
python-multipart==0.0.9
pytz==2024.1
PyYAML==6.0.1
pyzmq==26.0.3
requests==2.32.3
rich==13.7.1
rsa==4.9
shellingham==1.5.4
six==1.16.0
sniffio==1.3.1
soupsieve==2.5
SQLAlchemy==2.0.31
stack-data==0.6.3
starlette==0.37.2
time-machine==2.14.2
tornado==6.4.1
tortoise-orm==0.21.5
traitlets==5.14.3
typer==0.12.3
typing_extensions==4.12.2
tzdata==2024.1
ujson==5.10.0
urllib3==2.2.2
uvicorn==0.30.3
uvicorn==0.30.1
uvloop==0.19.0
watchfiles==0.22.0
wcwidth==0.2.13
websockets==12.0
yarl==1.9.4