-
Notifications
You must be signed in to change notification settings - Fork 0
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
liuwen
committed
Sep 21, 2024
1 parent
e5aa6ab
commit 8c809b3
Showing
8 changed files
with
112 additions
and
3 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,45 @@ | ||
name: Build and Push | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
paths: | ||
- 'deepnote/**' | ||
- '.github/workflows/deepnote-build.yml' | ||
workflow_dispatch: # Allow manual triggering | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: deepnote-mpdev | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "katbin/source"] | ||
path = katbin/source | ||
url = https://github.com/SphericalKat/katbin | ||
[submodule "one-hub"] | ||
path = one-hub | ||
url = https://github.com/MartialBE/one-hub |
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
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,51 @@ | ||
FROM bitnami/python:3.12-debian-12 | ||
|
||
# Switch to root user | ||
USER root | ||
|
||
# Install system dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
vim \ | ||
screen \ | ||
lsof \ | ||
netcat-openbsd \ | ||
mtr-tiny \ | ||
zsh \ | ||
wget \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Create necessary directories | ||
RUN mkdir -p /root/work/bin | ||
|
||
# Download and install Syncthing | ||
RUN SYNCTHING_VERSION=$(curl -s https://api.github.com/repos/syncthing/syncthing/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")') && \ | ||
wget https://github.com/syncthing/syncthing/releases/download/${SYNCTHING_VERSION}/syncthing-linux-amd64-${SYNCTHING_VERSION}.tar.gz -O syncthing.tar.gz && \ | ||
tar -xzf syncthing.tar.gz && \ | ||
mv syncthing-linux-amd64-${SYNCTHING_VERSION}/syncthing /root/work/bin/ && \ | ||
rm -rf syncthing-linux-amd64-${SYNCTHING_VERSION} syncthing.tar.gz | ||
|
||
# Install Bun | ||
RUN curl -fsSL https://bun.sh/install | bash \ | ||
&& mv /root/.bun /root/work/bun | ||
|
||
# Set up PATH | ||
ENV PATH="/root/work/bin:/root/work/bun/bin:${PATH}" | ||
|
||
# Set up Python virtual environment | ||
RUN python -m venv venv \ | ||
&& . venv/bin/activate \ | ||
&& rm -rf ~/.cache/pip | ||
ENV PATH="/root/work/venv/bin:${PATH}" | ||
|
||
# Copy requirements.txt and install Python dependencies | ||
COPY requirements.txt /root/work/ | ||
WORKDIR /root/work | ||
|
||
# Set default shell to zsh | ||
SHELL ["/bin/zsh", "-c"] | ||
|
||
# Activate virtual environment in zsh | ||
RUN echo "source /root/work/venv/bin/activate" >> ~/.zshrc | ||
|
||
CMD ["/bin/zsh"] |
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,3 @@ | ||
pydantic | ||
httpx | ||
fastapi |
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
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