local dev upgrades

This commit is contained in:
Jim Moffet
2022-06-13 14:26:46 -07:00
parent 543be77776
commit 2b727e13b4
10 changed files with 179 additions and 17 deletions

View File

@@ -0,0 +1,42 @@
{
"name": "notification-admin",
"dockerComposeFile": "../docker-compose.devcontainer.yml",
"service": "admin",
"workspaceFolder": "/workspace",
"shutdownAction": "stopCompose",
"remoteEnv": {
"PATH": "/home/vscode/.local/bin:${containerEnv:PATH}" // give our installed Python modules precedence
},
"settings": {
"[python]": {
"editor.formatOnSave": true
},
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.pythonPath": "/usr/local/bin/python"
},
"features": {
"docker-from-docker": {
"version": "latest",
"moby": true
}
},
"extensions": [
"ms-python.black-formatter",
"donjayamanne.python-extension-pack",
"ms-azuretools.vscode-docker",
"ms-python.vscode-pylance",
"eamodio.gitlens",
"wholroyd.jinja",
"pmbenjamin.vscode-snyk",
"visualstudioexptteam.vscodeintellicode",
"yzhang.markdown-all-in-one",
"ms-ossdata.vscode-postgresql",
"GitHub.copilot"
],
"forwardPorts": [
6012
],
"postCreateCommand": "chmod u+x devcontainer-admin/scripts/notify-admin-entrypoint.sh && ./devcontainer-admin/scripts/notify-admin-entrypoint.sh",
"remoteUser": "vscode"
}

View File

@@ -0,0 +1,52 @@
FROM mcr.microsoft.com/vscode/devcontainers/python:0-3.9
# RUN groupadd --gid 1000 node \
# && useradd --uid 1000 --gid node --shell /bin/bash --create-home node
ENV NODE_VERSION 16.15.1
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils 2>&1 \
&& apt-get -y install \
curl \
emacs \
exa \
fd-find \
git \
iproute2 \
less \
libsodium-dev \
lsb-release \
man-db \
manpages \
net-tools \
nodejs \
npm \
openssh-client \
procps \
sudo \
tldr \
unzip \
vim \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
RUN echo $(node --version)
RUN echo $(npm --version)
# Upgrade pip
RUN pip install --upgrade pip
RUN groupadd --gid 1001 node \
&& useradd --uid 1001 --gid node --shell /bin/bash --create-home node
COPY package-lock.json ./
COPY package.json ./
COPY devcontainer-admin/scripts/notify-admin-entrypoint.sh ./
RUN npm ci --no-audit
ENV SHELL /bin/zsh
EXPOSE 6012

View File

@@ -0,0 +1,36 @@
#!/bin/bash
set -ex
###################################################################
# This script will get executed *once* the Docker container has
# been built. Commands that need to be executed with all available
# tools and the filesystem mount enabled should be located here.
###################################################################
# Define aliases
echo -e "\n\n# User's Aliases" >> ~/.zshrc
echo -e "alias fd=fdfind" >> ~/.zshrc
echo -e "alias l='ls -al --color'" >> ~/.zshrc
echo -e "alias ls='exa'" >> ~/.zshrc
echo -e "alias l='exa -alh'" >> ~/.zshrc
echo -e "alias ll='exa -alh@ --git'" >> ~/.zshrc
echo -e "alias lt='exa -al -T -L 2'" >> ~/.zshrc
cd /workspace
# Warm up git index prior to display status in prompt else it will
# be quite slow on every invocation of starship.
git status
pip3 install -r requirements.txt
pip3 install -r requirements_for_test.txt
# npm rebuild node-sass
make generate-version-file
# make babel
# npm ci install
npm run build
# run flask
# make run