-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.go-nodejs
81 lines (66 loc) · 2.16 KB
/
Dockerfile.go-nodejs
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
# Use the latest Debian as the base image
FROM debian:bullseye AS base
# Set environment variable to make install non-interactive
ENV DEBIAN_FRONTEND=noninteractive
# Break pip system packages
ENV PIP_BREAK_SYSTEM_PACKAGES=1
# Update and install dependencies
RUN apt-get update && apt-get install -y \
software-properties-common \
curl \
xclip \
ripgrep \
unzip \
git \
bash \
build-essential \
python3 \
python3.10 \
python3-pip \
ca-certificates \
openssl \
&& pip install djhtml
# Install neovim
RUN curl -L -O "https://github.com/neovim/neovim/releases/download/stable/nvim-linux64.tar.gz" && \
tar xzvf nvim-linux64.tar.gz
# Install Go
ENV GO_VERSION 1.21.5
RUN curl -LO https://golang.org/dl/go$GO_VERSION.linux-amd64.tar.gz \
&& tar -C /usr/local -xzf go$GO_VERSION.linux-amd64.tar.gz \
&& rm go$GO_VERSION.linux-amd64.tar.gz
# Set PATH for Go
ENV PATH "/usr/local/go/bin:$PATH"
# Install Node.js using NVM
ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION v20.10.0
RUN mkdir -p $NVM_DIR \
&& curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash \
&& . $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
# Set PATH for Node.js
ENV PATH "$NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH"
# Install Node.js packages
RUN npm i -g vscode-langservers-extracted \
yaml-language-server prettier \
@johnnymorganz/stylua-bin \
pnpm
# Install Go development utilities
RUN go install github.com/cosmtrek/air@v1.49.0 \
&& go install golang.org/x/tools/cmd/goimports@latest \
&& go install golang.org/x/tools/gopls@latest
# Configure Git
RUN git config --global --add safe.directory '*' \
&& git config --global user.name "Carlos Molero" \
&& git config --global user.email "carlos@novascript.io" \
&& git config --global core.editor "nvim"
# Setup BASH-IT
RUN git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it && ~/.bash_it/install.sh
# Use custom .bashrc
COPY ./bashrc-template.txt /root/bashrc-template.txt
RUN mv ~/bashrc-template.txt ~/.bashrc
# Set the working directory
WORKDIR /workspace
# Keep the container running
CMD ["sleep", "infinity"]