feat: RAFNAV docker image

This commit is contained in:
JJ-Cronos 2024-05-15 16:54:22 +02:00
parent e32e2c7f37
commit 96a7a50d7c
5 changed files with 94 additions and 22 deletions

View file

@ -9,7 +9,37 @@
"ms-vscode.live-server", "ms-vscode.live-server",
"grapecity.gc-excelviewer", "grapecity.gc-excelviewer",
"mtxr.sqltools", "mtxr.sqltools",
"visualstudioexptteam.vscodeintellicode" "visualstudioexptteam.vscodeintellicode",
"deinsoftware.arrow-function-snippets",
"formulahendry.auto-rename-tag",
"aaron-bond.better-comments",
"joy-yu.css-snippets",
"mikestead.dotenv",
"vincaslt.highlight-matching-tag",
"njpwerner.autodocstring",
"ms-python.black-formatter",
"streetsidesoftware.code-spell-checker",
"dbaeumer.vscode-eslint",
"tamasfe.even-better-toml",
"github.vscode-github-actions",
"ecmel.vscode-html-css",
"wix.vscode-import-cost",
"oderwat.indent-rainbow",
"DavidAnson.vscode-markdownlint",
"christian-kohler.npm-intellisense",
"quicktype.quicktype",
"christian-kohler.path-intellisense",
"Postman.postman-for-vscode",
"esbenp.prettier-vscode",
"ms-python.vscode-pylance",
"ms-python.debugpy",
"donjayamanne.python-environment-manager",
"mechatroner.rainbow-csv",
"charliermarsh.ruff",
"jasonnutter.search-node-modules",
"redhat.vscode-xml",
"DotJoshJohnson.xml",
"redhat.vscode-yaml"
], ],
"settings": { "settings": {
"terminal.integrated.profiles.linux": { "terminal.integrated.profiles.linux": {

View file

@ -1,6 +1,30 @@
[ [
{ {
"url": "https://github.com/frappe/erpnext.git", "url": "https://github.com/cronos-capital/LMS.git",
"branch": "version-15" "branch": "main"
},
{
"url": "https://github.com/cronos-capital/RAFNAV_ERP.git",
"branch": "main"
},
{
"url": "https://github.com/cronos-capital/raf_finance.git",
"branch": "main"
},
{
"url": "https://github.com/cronos-capital/matter_management.git",
"branch": "main"
},
{
"url": "https://github.com/cronos-capital/documentation.git",
"branch": "main"
},
{
"url": "https://github.com/cronos-capital/filing.git",
"branch": "main"
},
{
"url": "https://github.com/cronos-capital/LRMS.git",
"branch": "main"
} }
] ]

View file

@ -48,16 +48,16 @@ def get_args_parser():
"--bench-name", "--bench-name",
action="store", action="store",
type=str, type=str,
help="Bench directory name, default: frappe-bench", help="Bench directory name, default: rafnav_dev",
default="frappe-bench", default="rafnav_dev",
) # noqa: E501 ) # noqa: E501
parser.add_argument( parser.add_argument(
"-s", "-s",
"--site-name", "--site-name",
action="store", action="store",
type=str, type=str,
help="Site name, should end with .localhost, default: development.localhost", # noqa: E501 help="Site name, should end with .localhost, default: rafnav.localhost", # noqa: E501
default="development.localhost", default="rafnav.localhost",
) )
parser.add_argument( parser.add_argument(
"-r", "-r",
@ -80,16 +80,16 @@ def get_args_parser():
"--py-version", "--py-version",
action="store", action="store",
type=str, type=str,
help="python version, default: Not Set", # noqa: E501 help="python version, default: 3.12.3", # noqa: E501
default=None, default="3.12.3",
) )
parser.add_argument( parser.add_argument(
"-n", "-n",
"--node-version", "--node-version",
action="store", action="store",
type=str, type=str,
help="node version, default: Not Set", # noqa: E501 help="node version, default: 20.13.1", # noqa: E501
default=None, default="20.13.1",
) )
parser.add_argument( parser.add_argument(
"-v", "-v",

View file

@ -97,7 +97,7 @@ WORKDIR /home/frappe
# Install Python via pyenv # Install Python via pyenv
ENV PYTHON_VERSION_V14=3.10.13 ENV PYTHON_VERSION_V14=3.10.13
ENV PYTHON_VERSION=3.11.6 ENV PYTHON_VERSION=3.12.3
ENV PYENV_ROOT /home/frappe/.pyenv ENV PYENV_ROOT /home/frappe/.pyenv
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
@ -122,27 +122,36 @@ RUN git clone ${GIT_REPO} --depth 1 -b ${GIT_BRANCH} .bench \
&& echo "export PATH=/home/frappe/.local/bin:\$PATH" >>/home/frappe/.bashrc \ && echo "export PATH=/home/frappe/.local/bin:\$PATH" >>/home/frappe/.bashrc \
&& echo "export BENCH_DEVELOPER=1" >>/home/frappe/.bashrc && echo "export BENCH_DEVELOPER=1" >>/home/frappe/.bashrc
# Install homebrew and wget
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" \
&& (echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/frappe/.profile \
&& eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" \
&& brew install gcc \
&& brew install wget
# Add aliases
RUN touch $HOME/.bash_aliases \
&& echo "alias py='python'" >> $HOME/.bash_aliases \
&& echo "alias frap-install='py installer.py'" >> $HOME/.bash_aliases
# Install Node via nvm # Install Node via nvm
ENV NODE_VERSION_14=16.20.2 ENV NODE_VERSION_STABLE=16.20.2
ENV NODE_VERSION=18.18.2 ENV NODE_VERSION=20.13.1
ENV NVM_DIR /home/frappe/.nvm ENV NVM_DIR /home/frappe/.nvm
ENV PATH ${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/:${PATH} ENV PATH ${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/:${PATH}
RUN wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash \ RUN wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash \
&& . ${NVM_DIR}/nvm.sh \ && . ${NVM_DIR}/nvm.sh \
&& nvm install ${NODE_VERSION_14} \ && nvm install ${NODE_VERSION_STABLE} \
&& nvm use v${NODE_VERSION_14} \ && nvm use v${NODE_VERSION_STABLE} \
&& npm install -g yarn \ && npm install -g yarn \
&& nvm install ${NODE_VERSION} \ && nvm install v${NODE_VERSION} \
&& nvm use v${NODE_VERSION} \
&& npm install -g yarn \ && npm install -g yarn \
&& nvm alias default v${NODE_VERSION} \
&& rm -rf ${NVM_DIR}/.cache \ && rm -rf ${NVM_DIR}/.cache \
&& echo 'export NVM_DIR="/home/frappe/.nvm"' >>~/.bashrc \ && echo 'export NVM_DIR="/home/frappe/.nvm"' >>~/.bashrc \
&& echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ && echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
&& echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion' >> ~/.bashrc && echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion' >> ~/.bashrc
EXPOSE 8000-8005 9000-9005 6787 EXPOSE 8000-8005 9000-9005 6787
FROM bench as bench-test FROM bench as bench-test

View file

@ -1,4 +1,4 @@
ARG PYTHON_VERSION=3.11.6 ARG PYTHON_VERSION=3.12.3
ARG DEBIAN_BASE=bookworm ARG DEBIAN_BASE=bookworm
FROM python:${PYTHON_VERSION}-slim-${DEBIAN_BASE} AS base FROM python:${PYTHON_VERSION}-slim-${DEBIAN_BASE} AS base
@ -44,7 +44,7 @@ RUN useradd -ms /bin/bash frappe \
&& nvm install ${NODE_VERSION} \ && nvm install ${NODE_VERSION} \
&& nvm use v${NODE_VERSION} \ && nvm use v${NODE_VERSION} \
&& npm install -g yarn \ && npm install -g yarn \
&& nvm alias default v${NODE_VERSION} \ && nvm install --lts \
&& rm -rf ${NVM_DIR}/.cache \ && rm -rf ${NVM_DIR}/.cache \
&& echo 'export NVM_DIR="/home/frappe/.nvm"' >>/home/frappe/.bashrc \ && echo 'export NVM_DIR="/home/frappe/.nvm"' >>/home/frappe/.bashrc \
&& echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >>/home/frappe/.bashrc \ && echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >>/home/frappe/.bashrc \
@ -72,6 +72,15 @@ RUN useradd -ms /bin/bash frappe \
&& chmod 755 /usr/local/bin/nginx-entrypoint.sh \ && chmod 755 /usr/local/bin/nginx-entrypoint.sh \
&& chmod 644 /templates/nginx/frappe.conf.template && chmod 644 /templates/nginx/frappe.conf.template
# Install homebrew and wget
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" \
&& brew install wget
# Add aliases
RUN touch $HOME/.bash_aliases \
&& echo "alias py='python'" >> $HOME/.bash_aliases \
&& echo "alias frap-install='py installer.py'" >> $HOME/.bash_aliases
FROM base AS builder FROM base AS builder
RUN apt-get update \ RUN apt-get update \