-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
139 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,36 @@ | ||
name: Build and Push docker images | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "docker/**" | ||
- ".github/workflows/build-images.yml" | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
env: | ||
IMAGE_NAME: mkdocs | ||
USERNAME: ${{ github.repository_owner }} | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build dev image | ||
run: | | ||
cd docker/dev | ||
docker build . -t ghcr.io/${{ env.USERNAME }}/${{ env.IMAGE_NAME }}:latest | ||
- name: Push Docker image to GitHub Container Registry | ||
run: docker push ghcr.io/${{ env.USERNAME }}/${{ env.IMAGE_NAME }}:latest |
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,74 @@ | ||
FROM python:3-slim | ||
|
||
ARG USERNAME=dev | ||
ARG UID=1000 | ||
ARG GID=1000 | ||
ARG VERSION="python-dev" | ||
|
||
# Create the user | ||
RUN groupadd --gid $GID $USERNAME \ | ||
&& useradd --uid $UID --gid $GID -m $USERNAME \ | ||
# | ||
# [Optional] Add sudo support. Omit if you don't need to install software after connecting. | ||
&& apt-get update \ | ||
&& apt-get install -y sudo \ | ||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ | ||
&& chmod 0440 /etc/sudoers.d/$USERNAME | ||
|
||
# dialout group | ||
RUN usermod -a -G dialout $USERNAME | ||
|
||
# install packages | ||
RUN apt-get install -y \ | ||
locales \ | ||
tree \ | ||
git \ | ||
git-lfs \ | ||
mosquitto-clients \ | ||
iputils-ping \ | ||
picocom \ | ||
socat \ | ||
libgl1 \ | ||
rsync \ | ||
graphviz | ||
|
||
# cleanup | ||
RUN rm -rf /var/lib/apt/lists/* | ||
|
||
# set locale | ||
RUN export LC_ALL=en_US.UTF-8 | ||
RUN export LANG=en_US.UTF-8 | ||
RUN locale-gen en_US.UTF-8 | ||
|
||
RUN pip install --upgrade pip | ||
|
||
|
||
USER ${USERNAME} | ||
RUN echo 'export PS1="🐍 \[\033[1;36m\]'"${VERSION}"' \[\e[33m\]\W\[\e[m\] \[\033[1;36m\]# \[\033[0m\]"' >> ~/.bashrc | ||
|
||
# add local bin to path | ||
RUN echo "export PATH=\$PATH:/home/${USERNAME}/.local/bin" >> ~/.bashrc | ||
ENV PATH="${PATH}:/home/${USERNAME}/.local/bin" | ||
|
||
WORKDIR /home/${USERNAME} | ||
|
||
|
||
# setup folders for saving vscode extensions | ||
# https://code.visualstudio.com/remote/advancedcontainers/avoid-extension-reinstalls | ||
RUN mkdir -p /home/$USERNAME/.vscode-server/extensions \ | ||
&& chown -R $USERNAME \ | ||
/home/$USERNAME/.vscode-server | ||
|
||
|
||
# install requirements | ||
COPY requirements.txt requirements.txt | ||
RUN pip3 install -r requirements.txt && rm requirements.txt | ||
|
||
|
||
# build timestamp | ||
USER root | ||
RUN echo ${VERSION} >> /build_date.txt && \ | ||
date >> /build_date.txt | ||
|
||
USER ${USERNAME} | ||
WORKDIR /home/${USERNAME} |
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,28 @@ | ||
black | ||
build | ||
bumpversion | ||
click | ||
coloredlogs | ||
coverage | ||
invoke | ||
ipython | ||
jupyterlab | ||
matplotlib | ||
mkdocs | ||
mkdocs-glightbox | ||
mkdocs-jupyter | ||
mkdocs-macros-plugin | ||
mkdocs-material | ||
mkdocs-mermaid2-plugin | ||
mkdocstrings | ||
mkdocstrings-python | ||
mypy | ||
numpy | ||
orjson | ||
pre-commit | ||
pydantic | ||
pylint | ||
pytest | ||
pytest-asyncio | ||
pytest-cov | ||
ruff |
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
|
||
# Constants | ||
CI_IMG = "roxbot-ci" | ||
MKDOCS_IMG = "roxbot-mkdocs" | ||
|
||
|
||
@task | ||
|