crimsontome.com/README.md

80 lines
3.0 KiB
Markdown
Raw Normal View History

2021-10-20 15:33:11 +01:00
# CrimsonTome's Blog
2022-09-17 03:03:22 +01:00
2022-09-04 01:48:36 +01:00
> My personal blog documenting my journey into open-source development alongside other things.
> Created with 11ty, hosted in a docker container on my VPS
2022-09-04 01:59:48 +01:00
[![CI](https://github.com/CrimsonTome/crimsontome-blog/actions/workflows/node%20CI.yml/badge.svg)](https://github.com/CrimsonTome/crimsontome-blog/actions/workflows/node%20CI.yml)
[![Publish Docker image](https://github.com/CrimsonTome/crimsontome-blog/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/CrimsonTome/crimsontome-blog/actions/workflows/docker-publish.yml)
![Repo Size](https://img.shields.io/github/repo-size/crimsontome/crimsontome-blog)
![Commit Activity /month](https://img.shields.io/github/commit-activity/m/crimsontome/crimsontome-blog)
![Last git commit](https://img.shields.io/github/last-commit/crimsontome/crimsontome-blog)
2022-09-17 03:36:06 +01:00
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
2022-11-07 00:08:41 +00:00
- [CrimsonTome's Blog](#crimsontomes-blog)
- [Development](#development)
- [Building](#building)
- [Node](#node)
- [Docker](#docker)
- [Dockerfile](#dockerfile)
- [Ouroboros](#ouroboros)
- [Contributing](#contributing)
- [Changelog](#changelog)
- [License](#license)
2022-09-04 01:48:36 +01:00
## Development
2021-10-20 02:25:45 +01:00
2022-09-17 03:03:22 +01:00
- clone the repo
- run `npm i` to install dependencies
- `npm run serve`
2022-09-17 03:03:22 +01:00
- make some changes and watch them update in the browser
2022-09-04 01:48:36 +01:00
## Building
2021-10-15 23:02:37 +01:00
2022-09-04 01:48:36 +01:00
### Node
2021-10-16 18:51:28 +01:00
2022-09-17 03:03:22 +01:00
- run `npm run build`
2022-06-05 15:45:35 +01:00
2022-09-04 01:48:36 +01:00
### Docker
The site can also be built and ran inside a docker container when you are in the base of the repo:
2022-09-17 03:03:22 +01:00
- `sudo docker build -t crimsontome-blog .`
- `sudo docker run -itd -p unused-port-number:80 crimsontome-blog`
- visit `localhost:port` or `ip:port` if you are hosting on a VPS and the site should be available to view
2022-09-04 01:48:36 +01:00
## Dockerfile
```dockerfile
2022-09-04 16:31:01 +01:00
FROM node:18-alpine3.15 as npmpackages
2022-09-04 01:48:36 +01:00
WORKDIR /app
COPY package.json .
RUN npm install
2022-09-04 16:31:01 +01:00
FROM node:18-alpine3.15 as builder
2022-09-04 01:48:36 +01:00
WORKDIR /app
COPY --from=npmpackages /app /app
COPY . .
RUN npm run build
FROM nginx:1.17.10-alpine
RUN rm -r /usr/share/nginx/html/
COPY --from=builder /app/_site/ /usr/share/nginx/html/
2022-09-04 16:31:01 +01:00
2022-09-04 01:48:36 +01:00
```
2022-09-17 03:03:22 +01:00
2022-09-04 01:48:36 +01:00
### Ouroboros
2022-09-04 01:50:26 +01:00
Using a tool like [Ouroboros](https://github.com/pyouroboros/ouroboros), you can automatically update containers without the need for restarts. This site is setup with that so you can (instead of building it yourself like above) with `sudo docker run -d -p unused-port-number:80 crimsontome427:crimsontome-blog`
2022-09-04 01:48:36 +01:00
## Contributing
2021-10-21 05:51:10 +01:00
2021-10-21 05:52:51 +01:00
See [CONTRIBUTING.md](CONTRIBUTING.md) for information on adding to this repository.
2022-09-04 01:48:36 +01:00
2022-11-07 00:08:41 +00:00
## Changelog
Run `./changelog` to generate the changelog after your commit, then `git add . && git commit --amend --no-edit
` to generate the changelog
The changelog is available [here](CHANGELOG.md)
2022-09-04 01:48:36 +01:00
## License
crimsontome-blog is released under the MIT License. The full license text is included in the [LICENSE](LICENSE.md) file in this repository. Tldr legal have a [great summary](https://tldrlegal.com/license/mit-license) of the license if you're interested.