nim-theNewWeb/Dockerfile

88 lines
3.0 KiB
Docker

# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
# Base image
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
FROM kalilinux/kali-rolling:latest
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
# Environnement
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
WORKDIR /www
ENV PATH="/root/.nimble/bin:$PATH"
RUN echo "export PATH=/root/.nimble/bin:$PATH" >> /root/.bashrc
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
# update and install os requirements
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
RUN apt-get update
RUN apt-get install -y bash
# RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
RUN apt-get install -y curl wget gcc xz-utils git libsqlite3-dev
RUN apt-get install -y npm nodejs
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
# install pkgs for DEV and debug
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
RUN apt-get install -y htop net-tools
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
# install Joplin terminal
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
RUN node -v
RUN npm -v
RUN NPM_CONFIG_PREFIX=~/.joplin-bin npm install -g joplin
RUN ln -s /root/.joplin-bin/bin/joplin /usr/bin/joplin
# --==--==--==--==--==--==--==--==--==--==-- #
# Joplin DEV Configuration
# --==--==--==--==--==--==--==--==--==--==-- #
RUN joplin config sync.target 9
RUN joplin config sync.9.path https://joplinlab.bcmaison.cf
RUN joplin config sync.9.username joplinlab@zohomail.com
RUN joplin config sync.9.password Chab30017405
RUN joplin config locale en_US
COPY config/settings.json /root/.config/joplin
RUN joplin sync
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
# install nim language
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
RUN wget https://nim-lang.org/choosenim/init.sh
RUN sh init.sh -y
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
# install nim requirments
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
RUN nimble install -y jester bcrypt templates xlsx zip
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
# copy reverse proxy
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
COPY mitmproxy/mitmweb /www/mitmproxy/mitmweb
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
# copy project
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
COPY config /www/config
ADD data /www/data
ADD nim-lib /www/nim-lib
ADD public /www/public
ADD tmpl /www/tmpl
COPY config.nims /www
COPY main.nim /www
COPY start_main.sh /www
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
# Project nim compilation
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
RUN nimble list -i
RUN nim c -f ./main.nim
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
# Start Joplin-TheNewWeb
# --==--==--==--==--==--==--==--==--==--==--==--==--==--==-- #
CMD ["/www/start_main.sh"]