-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
98 lines (87 loc) · 3.3 KB
/
Dockerfile
File metadata and controls
98 lines (87 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Use docker image with Debian Bookworm Slim as the base
FROM debian:bookworm-slim
# Step 1: Install locales and generate them
RUN apt-get update && \
apt-get install -y --no-install-recommends \
locales \
direnv \
gnupg \
less \
zip \
nano \
curl \
git \
zsh \
ca-certificates \
make \
build-essential \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
wget \
llvm \
libncurses5-dev \
libncursesw5-dev \
xz-utils \
tk-dev \
libffi-dev \
liblzma-dev \
python3-openssl \
ffmpeg && \
# Add GitHub CLI repo
mkdir -p -m 755 /etc/apt/keyrings && \
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/etc/apt/keyrings/githubcli-archive-keyring.gpg && \
chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null && \
apt-get update && \
apt-get install -y --no-install-recommends gh && \
# --- GitHub Auth Automation & Docker Compatibility (todo gitlab) ---
git config --global credential."https://github.com".helper "!gh auth git-credential" && \
git config --global --add safe.directory '*' && \
git config --global core.excludesfile ~/.gitignore_global && \
echo ".envrc" >> ~/.gitignore_global && \
# ---------------------------------------------
# locale configuration
echo "fr_FR.UTF-8 UTF-8" >> /etc/locale.gen && \
locale-gen fr_FR.UTF-8 && \
# direnv hook for ZSH (to activate direnv on 'cd')
echo 'eval "$(direnv hook zsh)"' >> /root/.zshrc && \
# APT cache cleanup
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Step 2 : Set environment variables for locale
ENV LANG=fr_FR.UTF-8 \
LANGUAGE=fr_FR:en \
LC_ALL=fr_FR.UTF-8
# Install NVM (Node Version Manager)
ENV NVM_DIR="/root/.nvm"
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash && \
. "$NVM_DIR/nvm.sh" && \
nvm install 20 && \
nvm alias default 20 && \
nvm use default
# Instal Pyenv & pyenv-virtualenv
ENV PYENV_ROOT="/root/.pyenv"
ENV PATH="$PYENV_ROOT/bin:$PATH"
RUN git clone https://github.com/pyenv/pyenv.git ~/.pyenv && \
git clone https://github.com/pyenv/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv && \
export PATH="$PYENV_ROOT/bin:$PATH" && \
eval "$(pyenv init -)" && \
pyenv install 3.12.0 && \
pyenv global 3.12.0
# Configure ZSH as the default shell for root user
SHELL ["/usr/bin/zsh", "-l", "-c"]
# Install Oh My Zsh
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
# Install Powerlevel10k theme for Oh My Zsh
RUN git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
# Copy .zshrc configuration file inside the container
COPY .zshrc-config /root/.zshrc
# Copy the Powerlevel10k configuration file inside the container
COPY .p10k-zsh-config /root/.p10k.zsh
# Setup the working directory
WORKDIR /app
# Default command when the container starts (launches a Zsh shell)
CMD ["zsh"]