Skip to content

Commit

Permalink
feat: docker image (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkho authored Nov 4, 2023
1 parent 8802b9f commit b9bbc04
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:lts AS builder

WORKDIR /app
COPY . .
RUN corepack enable
RUN pnpm install --frozen-lockfile --strict-peer-dependencies
RUN pnpm run build

# the final image, only need to serve the static files
FROM nginx:alpine

RUN apk update && apk upgrade
COPY --from=builder /app/build /usr/share/nginx/html
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,21 @@ npm start
npm run dev-server
```

## Deployment in Production

After building (`npm run build`), the `build` folder is the static website files.
You can deploy it to any CDN or static file server.

You can also build a docker image using the `Dockerfile` at the root of this repo.
It runs the build and give you a minimal nginx image.

```bash
# build image
docker build -t lrc-maker .
# create a container and serve at port 8080
docker run -d -p 8080:80 lrc-maker
```

## Star this project :star:

If you like give us a star :star: Share this project to help more people.
Expand Down Expand Up @@ -171,6 +186,21 @@ npm start
npm run dev-server
```

## 生产部署

构建(`npm run build`)后,`build` 文件夹是静态网站文件。
您可以将其部署到任何 CDN 或静态文件服务器。

您还可以使用此存储库根目录下的 `Dockerfile` 构建一个 docker 镜像。
它运行构建并创建最小化的 nginx 镜像。

```bash
# 构建
docker build -t lrc-maker .
# 创建一个容器并在 8080 端口提供服务
docker run -d -p 8080:80 lrc-maker
```

## 给这个项目点一个星星 :star:

如果你喜欢这个项目,请点一个星星吧:star:,分享这个项目来帮助更多的人。
Expand Down

1 comment on commit b9bbc04

@vercel
Copy link

@vercel vercel bot commented on b9bbc04 Nov 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lrc-maker – ./

lrc-maker.vercel.app
lrc-maker-magic-akari.vercel.app
lrc-maker-git-master-magic-akari.vercel.app

Please sign in to comment.