add python image
This commit is contained in:
parent
80a2841e6b
commit
52b93a7b94
5
python/Dockerfile
Normal file
5
python/Dockerfile
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
ARG VERSION="latest"
|
||||||
|
FROM registry.tomastm.com/base-debian:${VERSION}
|
||||||
|
|
||||||
|
COPY install-packages.sh /tmp/install-packages.sh
|
||||||
|
RUN sudo chmod +x /tmp/install-packages.sh && /tmp/install-packages.sh && sudo rm /tmp/install-packages.sh
|
||||||
26
python/README.md
Normal file
26
python/README.md
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# Dev containers
|
||||||
|
|
||||||
|
## Commands
|
||||||
|
|
||||||
|
Build
|
||||||
|
```
|
||||||
|
docker build \
|
||||||
|
--build-arg UID=$(id -u) \
|
||||||
|
--build-arg GID=$(id -g) \
|
||||||
|
-t web-stack .
|
||||||
|
```
|
||||||
|
|
||||||
|
Run. Mount /workspace if you want to preserve changes. Mount /workspace if you want to preserve changes.
|
||||||
|
```
|
||||||
|
podman run -it --rm \
|
||||||
|
--userns=keep-id \
|
||||||
|
--network host \
|
||||||
|
-v $HOME/.ssh:/home/dev/.ssh:ro,Z \
|
||||||
|
-v $PWD:/workspace:Z \
|
||||||
|
my-dev-container
|
||||||
|
```
|
||||||
|
|
||||||
|
## Installed tools
|
||||||
|
- Common ones: curl, git, vim, tmux, zsh. Included dotfiles.
|
||||||
|
- NVM and nodejs (lts, v18, v20, v22).
|
||||||
|
- All package managers preinstalled (npm, pnpm, yarn). Enable with `corepack enable <pm>`.
|
||||||
19
python/install-packages.sh
Normal file
19
python/install-packages.sh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
sudo apt-get update && sudo apt-get install -y \
|
||||||
|
python3-pip python3-venv
|
||||||
|
|
||||||
|
# Install Poetry
|
||||||
|
curl -sSL https://install.python-poetry.org | python3 -
|
||||||
|
|
||||||
|
# Ensure Poetry is in PATH
|
||||||
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
|
||||||
|
# Configure Poetry to use in-project virtual environments
|
||||||
|
poetry config virtualenvs.in-project true
|
||||||
|
|
||||||
|
sudo apt-get clean && sudo rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
echo "Poetry and venv installed successfully!"
|
||||||
Loading…
Reference in New Issue
Block a user