1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-11 21:10:26 +00:00

Add Dockerfile (#63)

Co-authored-by: handlerug <umar@handlerug.me>
This commit is contained in:
Alex Gu 2021-06-09 17:20:46 +03:00 committed by GitHub
parent 9cb552fa72
commit 8bd00c7f37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 48 additions and 0 deletions

18
Dockerfile Normal file
View File

@ -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"]

View File

@ -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