-
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
f37d243
commit 39f7983
Showing
5 changed files
with
132 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,7 @@ | ||
- syncthing. Easily sync files between workstations and containers | ||
- bun. build & run javascript/typescript projects | ||
- basic sys utils. mtr, lsof, nc, screen, etc. | ||
|
||
## IN CONSIDERATION | ||
- a separate image with python 3.12 + llamaindex + other LLM dev stuff, of course, with utils. | ||
- image with caddy for more hosting options |
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,53 @@ | ||
FROM bitnami/python:3.11-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 working directory | ||
WORKDIR /root/work | ||
|
||
# Set up Python virtual environment | ||
RUN python -m venv venv \ | ||
&& . venv/bin/activate \ | ||
&& rm -rf ~/.cache/pip | ||
|
||
# Copy requirements.txt and install Python dependencies | ||
COPY requirements.txt . | ||
RUN . venv/bin/activate && pip install -r requirements.txt | ||
|
||
# Set default shell to zsh | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
# Activate virtual environment in bash | ||
RUN echo "source /root/work/venv/bin/activate" >> ~/.bashrc | ||
|
||
CMD ["/bin/bash"] |
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,6 @@ | ||
pydantic | ||
httpx | ||
fastapi | ||
pandas | ||
matplotlib | ||
tabulate |
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,63 @@ | ||
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 working directory | ||
WORKDIR /root/work | ||
|
||
# Install HAProxy | ||
RUN curl https://haproxy.debian.net/bernat.debian.org.gpg | gpg --dearmor > /usr/share/keyrings/haproxy.debian.net.gpg && \ | ||
echo deb "[signed-by=/usr/share/keyrings/haproxy.debian.net.gpg]" \ | ||
http://haproxy.debian.net bookworm-backports-3.0 main \ | ||
> /etc/apt/sources.list.d/haproxy.list && \ | ||
apt-get update && \ | ||
apt-get install -y haproxy=3.0.\* && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Set up Python virtual environment | ||
RUN python -m venv venv \ | ||
&& . venv/bin/activate \ | ||
&& rm -rf ~/.cache/pip | ||
|
||
# Copy requirements.txt and install Python dependencies | ||
COPY requirements.txt . | ||
RUN . venv/bin/activate && pip install -r requirements.txt | ||
|
||
# Set default shell to zsh | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
# Activate virtual environment in bash | ||
RUN echo "source /root/work/venv/bin/activate" >> ~/.bashrc | ||
|
||
CMD ["/bin/bash"] |
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 @@ | ||
llama-index | ||
httpx | ||
fastapi |