crimsontome.com/README.md

60 lines
2.4 KiB
Markdown
Raw Normal View History

2021-10-20 15:33:11 +01:00
# CrimsonTome's Blog
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-04 01:48:36 +01:00
## Development
2021-10-20 02:25:45 +01:00
2022-09-04 01:48:36 +01:00
- clone the repo
- run `npm i` to install dependencies
- npm `run serve`
- make some changes and watch them update in the browser
## 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-04 01:48:36 +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:
- `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
## Dockerfile
```dockerfile
FROM node:10-alpine3.9 as npmpackages
WORKDIR /app
COPY package.json .
RUN npm install
FROM node:10-alpine3.9 as builder
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/
```
### 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
## 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.