当前位置:网站首页>Docker container Django + MySQL service
Docker container Django + MySQL service
2022-07-24 23:49:00 【Clean night mortal dust】
docker Containerization django + mysql service
Introduce
Use django Simple implementation in web The interface is incremented 、 Delete 、 Change 、 Check the operation of the , In order to facilitate deployment , The service is made into a mirror .
Dockerfile
FROM python:3-alpine
COPY . /opt/
WORKDIR /opt/
# The point is : Need to install gcc And other related compilation tools , To compile mysqlclient, Otherwise, an error will occur when installing the environment
RUN apk add --update --no-cache mariadb-connector-c-dev \
&& apk add --no-cache --virtual .build-deps \
mariadb-dev \
gcc \
musl-dev \
&& pip3 install -r requirements.txt \
&& apk del .build-deps
EXPOSE 8000
CMD python3 manage.py runserver 0.0.0.0:8000
Build run
docker build -t xxx/django-web .
# Upload to private warehouse
docker push xxx/django-web:latest
Now I can run my under any system django service .
Demo code :https://gitee.com/glnp/django-mysql-test/tree/master
边栏推荐
- How to speculate on the Internet? Is it safe to speculate on mobile phones
- Go基础笔记_4_map
- Financial products can reach 6%. I want to open an account to buy financial products
- Notes of Teacher Li Hongyi's 2020 in-depth learning series 5
- 91. (leaflet chapter) leaflet situation plotting - offensive direction drawing
- Answers to some problems encountered in the process of Xperia XZ (f8332) brushing and root
- Convert a string to an integer and don't double it
- Go basic notes_ 4_ map
- Sql文件导入数据库-保姆级教程
- 指针与数组
猜你喜欢

Zheng Huijuan: Research on application scenarios and evaluation methods of data assets based on the unified market

C语言学习之分支与循环语句

来自大佬洗礼!2022 头条首发纯手打 MySQL 高级进阶笔记, 吃透 P7 有望

With screen and nohup running, there is no need to worry about deep learning code anymore | exiting the terminal will not affect the operation of server program code

Branch and loop statements in C language learning

Power consumption of chip

WP wechat export chat record backup to computer

Multithreading & high concurrency (the latest in the whole network: interview questions + map + Notes) the interviewer is calm

Digital stopwatch based on Verilog HDL
Browser cache
随机推荐
每周小结(*66):下一个五年
把字符串转换成整数与不要二
Notes of Teacher Li Hongyi's 2020 in-depth learning series 9
Restructuredtext grammar summary for beginners
痞子衡嵌入式:MCUXpresso IDE下将源码制作成Lib库方法及其与IAR,MDK差异
Install K6 test tool
JDBC 驱动升级到 Version 8.0.28 连接 MySQL 的踩坑记录
Notes of Teacher Li Hongyi's 2020 in-depth learning series 2
Shardingsphere database sub database sub table introduction
Use SQLite provided by the system
Three ways of shell debugging and debugging
芯片的功耗
Be an artistic test / development programmer and slowly change yourself
Beisen prospectus: the advantages of the track are prominent, and integration + medium and large customers are plus points
Power consumption of chip
codeforces round #805 ABCDEFG
Add a little surprise to life and be a prototype designer of creative life -- sharing with X contestants in the programming challenge
JS ------ Chapter 5 functions and events
How to propose effective solutions for high-end products? (1 methodology + 2 cases + 1 List)
Flash send email