Compare commits

...

2 Commits

Author SHA1 Message Date
2455fedc2b feat: add dockerfile 2025-09-23 14:23:30 +08:00
e926f521f6 docs: add MIT license and update project docs 2025-09-23 14:21:07 +08:00
3 changed files with 65 additions and 0 deletions

27
Dockerfile Normal file
View File

@@ -0,0 +1,27 @@
# syntax=docker/dockerfile:1
FROM ubuntu:24.04 AS base
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
clang \
clang-tidy \
clang-format \
cmake \
git \
ninja-build \
pkg-config && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY . .
RUN make install || true
RUN make
CMD ["./app"]

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 MH Hung
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -90,6 +90,23 @@ clang-tidy -quiet src/app/main.cpp -- -Iinclude
## 工具安裝
`make install` 會檢查是否能找到 `clang-format``clang-tidy`。若缺少任何一項且系統支援 `apt-get`,會嘗試以 `sudo apt-get update``sudo apt-get install -y` 安裝所需套件(若沒有 `sudo` 則直接呼叫 `apt-get`)。若環境沒有 `apt-get`,指令會提示手動安裝缺少的工具。
## 授權
此專案使用 [MIT License](LICENSE)。
## Docker
提供的 `Dockerfile` 會以 Ubuntu 24.04 建立開發環境,安裝 `clang``clang-tidy``clang-format` 等工具並執行 `make install``make`。可以使用以下指令建置並執行容器:
```bash
docker build -t cpp-template .
docker run --rm -it cpp-template
```
如果需要掛載原始碼以便互動開發,可使用:
```bash
docker run --rm -it -v "$(pwd)":/app -w /app cpp-template bash
```
## 下一步
-`src/` 新增更多檔案與模組。
- 依專案需求擴充 Makefile 或 utils 腳本。