The website for https://crystal-china.org
- Crystal Progrmaming Language
- postgresql
- nodejs(yarn)
- (Optional)wasm-pack (only for used with bin/tinysearch to create search index for markdowns)
Install all necessary development dependencies, then run lucky dev
.
There are no runtime dependencies when deploying to a remote Linux environment except one static binary with assets baked into it, and will auto mount when running.
Following is the process for create the static binary:
-
Run
shards run index
to create a tinysearch index for doc search. -
Run
yarn prod
to package assets with mix(webpack). -
To built a static binary use sb_static script. for more details instructions on building a static binary use zigcc, check use zig gcc as an an alternative linker
-
copy the built binary(
bin/crystal_china
) into remote linux host asbin/crystal_china
, then set the necessary ENV in file.env
, check the .env.sample for a example. You will have the following directory structure:. ├── .env └── bin/crystal_china
If server was started, you have to stop it before copy the binary. a more robust way to do this is use a binary diff tools create patch locally, and then apply it on server. this way the server no stop requried, just need reboot systemd service after done patching.
-
Add a systemd service to start the server, review the configuration for the crystal_china.service
-
Consider using procodile as an alternative for above .env and systemd services.
-
Optionally, use nginx as a reverse proxy. You can find configuration details in nginx folder
- Fork it (https://github.com/zw963/website/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- Billy.Zheng - creator and maintainer