Comments (4)
可以尝试再开一个 redis 的容器, 使用 --link
将其进行关联, 修改下main.py
删除 启动redis相关的命令,并修改 redis连接至 启动的容器就行了
from busuanzi_backend_self.
Dockerfile 文件
FROM python:3.9.5-alpine
WORKDIR /home/busuanzi
RUN pip install "redis==4.1.4"
RUN pip install "uvicorn==0.17.6"
RUN pip install "fastapi==0.75.0"
RUN pip install "requests==2.25.1"
ENTRYPOINT ["python3", "main.py"]
EXPOSE 4000
CMD ["/bin/sh"]
from busuanzi_backend_self.
本项目内的 redis-server
是适配的 replit
的架构...
如果是自己服务器部署的话,自行启动一个 redis
并注释相关代码吧
Lines 55 to 58 in 3586266
本项目近期将增加对于 docker
的支持...
不清楚这个报错什么原因...我电脑带不起来
docker
我的服务器是直接跑在
screen
里面的...服务器的
redis
直接用https://redis.io/docs/getting-started/installation/install-redis-on-linux/#install-on-ubuntudebian
sudo apt-get update sudo apt-get install redis等新电脑到了我支持一下对于
docker
的适配
from busuanzi_backend_self.
Dockerfile:
FROM python:3.9.5-alpine
WORKDIR /home/busuanzi
RUN pip install "redis==4.1.4"
RUN pip install "uvicorn==0.17.6"
RUN pip install "fastapi==0.75.0"
RUN pip install "requests==2.25.1"
ENTRYPOINT ["python3", "main.py"]
EXPOSE 4000
CMD ["/bin/sh"]
docker-compose:
version: "3"
services:
bsz_redis:
image: redis:latest
container_name: bsz_redis
restart: always
networks:
- bsz_net
environment:
- TZ=Asia/Shanghai
volumes:
- "/root/docker/busuanzi/data:/data"
busuanzi:
image: busuanzi:latest
container_name: busuanzi
restart: always
networks:
- bsz_net
ports:
- 0.0.0.0:22322:8080/tcp
environment:
- TZ=Asia/Shanghai
volumes:
- "/root/docker/busuanzi:/home/busuanzi"
networks:
bsz_net:
driver: "bridge"
按以上方案,并将main.py
内的redis服务器地址改为bsz_redis
,正常启动。
from busuanzi_backend_self.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from busuanzi_backend_self.