Docker玩法:cook 今天我们来学做菜

img

Cook,今天我们来学做菜


什么是 Cook ?

本项目初衷是方便特殊时期隔离在家而材料有限的小伙伴,因此菜谱材料会尽量限制在特定范围内。

官方的演示地址:https://cook.yunyoujun.cn/

img

还有小程序版版本:宅家食谱

img

构建镜像

如果你不想自己构建,可以跳过,直接阅读下一章节

是基于源代码构建的 Dockerfile

FROM node:16.5 as build-deps    
MAINTAINER laosu<wbsu2003@gmail.com>    

WORKDIR /cook    
COPY . ./  
RUN npm i -g pnpm  
RUN pnpm install  
RUN pnpm build  

FROM nginx:1.12-alpine    
COPY --from=build-deps /cook/dist /usr/share/nginx/html    

EXPOSE 80    
CMD ["nginx", "-g", "daemon off;"]

构建镜像和容器运行的基本命令如下👇

# 下载代码
git clone https://github.com/YunYouJun/cook.git

# 或通过代理下载
git clone https://ghproxy.com/github.com/YunYouJun/cook.git

# 进入目录
cd cook

# 将 Dockerfile 放到代码根目录

# 构建镜像
docker build -t wbsu2003/cook:v1 .

# 运行容器
docker run -d 
   --name cook 
   -p 3333:80 
   wbsu2003/cook:v1

Dockerfile 已经上传到了 githubhttps://github.com/wbsu2003/Dockerfile

安装

在群晖上以 Docker 方式安装。

在注册表中搜索 wbsu2003 ,下拉找到 wbsu2003/cook,版本选择 latest

img

镜像只有 16M

img

端口

本地端口不冲突就行

本地端口 容器端口
3333 80

img

运行

在浏览器中输入 http://群晖IP:3333 就能看到主界面

img

选择 胡萝卜

img

选择 胡萝卜炒蛋,直接打开了 B 站视频

img

手机上也是一样的

img

参考文档

YunYouJun/cook: 🍲 好的,今天我们来做菜!
地址:https://github.com/YunYouJun/cook

© 版权声明
THE END
喜欢就支持一下吧
点赞14 分享