Skip to content

Commit

Permalink
chore: add docker deploy (#14)
Browse files Browse the repository at this point in the history
* Create Dockerfile.yaml

Add Dockerfile

* Update README.md

Add Readme.md
  • Loading branch information
wenyang0 authored Dec 10, 2024
1 parent 548f39b commit 43c96b4
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Dockerfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use node as the builder image
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/guergeiro/pnpm:18-9

# Maintainer information
MAINTAINER [email protected]

# Showing that port 3000 can be published
EXPOSE 3000

# Copy the oneimg file from the local directory to the /app directory inside the container
COPY . /app

# Change the working directory to /app
WORKDIR /app

# Building the html code
RUN pnpm install --registry=https://registry.npmmirror.com/

#Start server
CMD pnpm dev -H 0.0.0.0
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,33 @@ pnpm install
# 启动项目
pnpm dev
```

## Docker 快速部署

你可以直接使用我已经构建好的镜像来运行
```sh
docker run -d -t -p 3000:3000 \
--name=oneimg \
--restart=always \
swr.ap-southeast-1.myhuaweicloud.com/wenyang0/oneimg:latest

```

或者,如果您愿意,也可以自己手动编译。

```sh
#下载代码
git clone https://github.com/byodian/oneimg.git

#docker 编译
cd oneimg/
docker build -t oneimg:v1 -f Dockerfile.yaml .

#启动服务
docker run -d -t -p 3000:3000 --name oneimg --restart=always oneimg:v1
```
最后,打开你的浏览器访问服务的地址 http://serverIP:3000 即可

## 使用方法
1. 打开应用后,首先创建主题
2. 选择预设的 CSS 样式模板
Expand Down

0 comments on commit 43c96b4

Please sign in to comment.