diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..579dc57 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM golang:alpine as build +WORKDIR src +COPY . . +ENV CGO_ENABLED=0 +RUN go generate +RUN go build -o /out/mycorrhiza . + +FROM alpine/git as app +EXPOSE 1737 + +WORKDIR / +RUN mkdir wiki +COPY --from=build /out/mycorrhiza /usr/bin + +WORKDIR /wiki +VOLUME /wiki +ENTRYPOINT ["mycorrhiza"] +CMD ["/wiki"] diff --git a/README.md b/README.md index dc15a79..395e378 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,42 @@ See [the guide](https://mycorrhiza.lesarbr.es/hypha/guide/deployment) on the wik ## Installing +### Pacman + If you use a linux distro with pacman package manager (Arch, Manjaro, Garuda, etc) you can install it using PKGBUILD: ```sh $ wget https://raw.githubusercontent.com/bouncepaw/mycorrhiza/master/PKGBUILD $ makepkg --install ``` +### Docker + +You can run Mycorrhiza Wiki in Docker using Dockerfile provided by this repository. Clone the repo and build the image: +```sh +$ git clone https://github.com/bouncepaw/mycorrhiza/ +$ docker build -t mycorrhiza . +``` + +Now you can create a new Mycorrhiza Wiki container using this command: +```sh +$ docker run -v /full/path/to/my/wiki:/wiki -p 1737:1737 mycorrhiza +``` + +Example: +```sh +$ cd /dev/shm +$ git clone https://github.com/bouncepaw/mycorrhiza/ +$ docker build -t mycorrhiza . +$ git clone https://github.com/bouncepaw/example-wiki +$ docker run -v /dev/shm/example-wiki:/wiki -p 1737:1737 mycorrhiza +``` + +Example 2: +```sh +... +$ docker run -v /dev/shm/:/config -v /dev/shm/example-wiki:/wiki -p 80:1737 mycorrhiza -config-path /config/myconfig.ini /wiki +``` + ## Usage ``` mycorrhiza [OPTIONS...] WIKI_PATH