This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2100 from omnidan/elektra-web-docker
Elektra Web - docker images
- Loading branch information
Showing
9 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Elektra Web docker images | ||
|
||
- `elektra/web-base` - base image for elektra web, all other images build upon this (builds elektra with `yajl` and `kdb`) | ||
- `elektra/elektrad` - image that only starts elektrad | ||
- `elektra/webd` - image that only starts webd | ||
- `elektra/elektrad-demo` - same as `elektrad`, but with a KDB config set up (for demo, should run on http://elektrad-demo.libelektra.org) | ||
- `elektra/webd-demo` - same as `webd`, but with 2 instances already created, they both connect to http://elektrad-demo.libelektra.org with different visibility levels (for demo, should run on http://webui.libelektra.org) | ||
- `elektra/web` - image that starts elektrad & webd (for those who just want to try out Elektra Web locally, also mentioned in quickstart in README of #2099) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# base image for elektra web, all other images build upon this (builds elektra with `yajl` and `kdb`) | ||
|
||
FROM ubuntu:16.04 | ||
|
||
# elektra deps | ||
RUN apt-get update -y | ||
RUN apt-get install -y cmake git build-essential | ||
|
||
# elektra web deps | ||
RUN apt-get install -y libyajl-dev curl nodejs-legacy npm | ||
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - | ||
RUN apt-get install -y nodejs | ||
|
||
# pull latest libelektra | ||
RUN mkdir /home/elektra | ||
WORKDIR /home/elektra | ||
ARG ELEKTRA_VER=master | ||
RUN git clone -b ${ELEKTRA_VER} --depth 1 https://github.com/ElektraInitiative/libelektra.git | ||
WORKDIR /home/elektra/libelektra | ||
|
||
# build & install libelektra | ||
RUN mkdir /home/elektra/libelektra/build | ||
WORKDIR /home/elektra/libelektra/build | ||
RUN cmake .. -DTOOLS="kdb;web" | ||
RUN make | ||
RUN make install | ||
|
||
# prepare user and home dir | ||
RUN groupadd -r elektra && useradd --no-log-init -r -g elektra elektra | ||
RUN chown -R elektra:elektra /home/elektra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# same as `elektrad`, but with a KDB config set up (for demo) | ||
|
||
FROM elektra/web-base:latest | ||
|
||
WORKDIR /home/elektra | ||
|
||
# prepare demo environment | ||
|
||
# mount copy of /etc/hosts to user/hosts | ||
|
||
# mount as root user | ||
RUN kdb mount --with-recommends hosts user/hosts hosts | ||
|
||
# then switch to elektra user | ||
USER elektra | ||
RUN mkdir /home/elektra/.config | ||
RUN cp /etc/hosts /home/elektra/.config/hosts | ||
|
||
# create user/app structure | ||
COPY --chown=elektra:elektra demo.kdb /home/elektra/ | ||
RUN kdb import user/app < /home/elektra/demo.kdb | ||
|
||
# run elektrad | ||
EXPOSE 33333 | ||
CMD ["kdb","run-elektrad"] |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# image that only starts elektrad | ||
|
||
FROM elektra/web-base:latest | ||
|
||
WORKDIR /home/elektra | ||
USER elektra | ||
|
||
# run elektrad | ||
EXPOSE 33333 | ||
CMD ["kdb","run-elektrad"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# image that starts elektrad & webd (for quickstart with elektra web) | ||
|
||
FROM elektra/web-base:latest | ||
|
||
WORKDIR /home/elektra | ||
USER elektra | ||
|
||
# create start script | ||
RUN printf "#!/bin/bash\nkdb run-elektrad &\nkdb run-web" > start | ||
RUN chmod +x start | ||
|
||
# run elektrad and webd in one container | ||
EXPOSE 33333 | ||
EXPOSE 33334 | ||
CMD ["/home/elektra/start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# same as `webd`, but with 2 instances already created, they both connect to http://elektrad-demo.libelektra.org with different visibility levels (for demo) | ||
|
||
FROM elektra/web-base:latest | ||
|
||
WORKDIR /home/elektra | ||
USER elektra | ||
|
||
# prepare demo environment | ||
COPY --chown=elektra:elektra demo.kdb /home/elektra/ | ||
RUN kdb import user/sw < /home/elektra/demo.kdb | ||
|
||
# run webd (serves client) | ||
EXPOSE 33334 | ||
CMD ["kdb","run-web"] |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# image that only starts webd | ||
|
||
FROM elektra/web-base:latest | ||
|
||
WORKDIR /home/elektra | ||
USER elektra | ||
|
||
# run webd (serves client) | ||
EXPOSE 33334 | ||
CMD ["kdb","run-web"] |