Skip to content

Commit bd92e38

Browse files
committed
feat(devcontainer): Better mise support in Dockerfile
1 parent 70d7c7c commit bd92e38

2 files changed

Lines changed: 27 additions & 15 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
FROM ubuntu:24.04
33

44
ENV DOCKER_BUILDKIT=1
5+
# macht mise global verfügbar
6+
ENV PATH="/root/.local/bin:${PATH}"
57

68
# Install Nginx
79
RUN apt-get -y update \
810
&& apt-get -y install nginx git curl gnupg software-properties-common --no-install-recommends \
911
&& rm -rf /var/lib/apt/lists/*
1012

11-
# Expose the port for access
12-
EXPOSE 3000/tcp
13-
1413
# Run the Nginx server
1514
CMD ["/usr/sbin/nginx", "-g", "daemon off;"]
1615

@@ -21,17 +20,21 @@ CMD ["/usr/sbin/nginx", "-g", "daemon off;"]
2120
SHELL ["/bin/bash", "-c"]
2221

2322
## Common tools
24-
RUN apt-get -y update && apt-get -y install neovim jq less openssl openssh-client gpg wget zip unzip autoconf patch build-essential rustc libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libgmp-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev uuid-dev --no-install-recommends
23+
RUN apt-get -y update && apt-get -y install neovim jq less openssl\
24+
openssh-client gpg wget zip unzip autoconf patch build-essential\
25+
rustc libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libgmp-dev\
26+
libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev uuid-dev\
27+
--no-install-recommends
2528

2629
## Mise
2730
RUN curl https://mise.run | sh \
2831
&& echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.bashrc
2932

3033
## Java
31-
# RUN ~/.local/bin/mise use java@lts -g
34+
# RUN mise use java@lts -g
3235

3336
## Nodejs
34-
# RUN ~/.local/bin/mise use node@lts -g
37+
# RUN mise use node@lts -g
3538

3639
# Funky Terminal
3740
RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.2.0/zsh-in-docker.sh)" -- \
@@ -60,9 +63,7 @@ RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/
6063
# && apt-get update && apt-get -y install terraform=1.9.2-* --no-install-recommends
6164

6265
## Kamal via mise and ruby
63-
# RUN curl https://mise.run | sh \
64-
# && echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.bashrc \
65-
# && ~/.local/bin/mise use --global ruby@3.2.2 \
66-
# && ~/.local/share/mise/installs/ruby/3.2.2/bin/gem install kamal
66+
# RUN mise use ruby@3.2.2 -g \
67+
# && mise x -- gem install kamal -v 1.9.2
6768

6869
WORKDIR /workspace

.devcontainer/devcontainer.json

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"name": "Existing Docker Compose (Extend)",
55
// Update the 'dockerComposeFile' list if you have more compose files or use different names.
66
// The .devcontainer/docker-compose.yml file contains any overrides you need/want to make.
7-
"dockerComposeFile": ["../docker-compose.yml"],
7+
"dockerComposeFile": [
8+
"../docker-compose.yml"
9+
],
810
//"overrideCommand": false,
911
//"postStartCommand": "/usr/sbin/nginx -g 'daemon off;'",
1012
// The 'service' property is the name of the service for the container that VS Code should
@@ -19,16 +21,26 @@
1921
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
2022
},
2123
// Use 'forwardPorts' to make a list of ports inside the container available locally.
22-
// "forwardPorts": [80]
24+
"forwardPorts": [3000,3001],
2325
// Uncomment the next line if you want start specific services in your Docker Compose config.
24-
"runServices": ["devcontainer"],
26+
"runServices": [
27+
"devcontainer"
28+
],
2529
"customizations": {
2630
"vscode": {
2731
"extensions": [
2832
"vivaxy.vscode-conventional-commits",
2933
"EditorConfig.EditorConfig",
3034
"ms-azuretools.vscode-docker"
31-
]
35+
],
36+
"settings": {
37+
"terminal.integrated.defaultProfile.linux": "zsh",
38+
"terminal.integrated.profiles.linux": {
39+
"zsh": {
40+
"path": "/usr/bin/zsh"
41+
}
42+
}
43+
}
3244
}
3345
}
3446
// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
@@ -40,4 +52,3 @@
4052
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
4153
// "remoteUser": "devcontainer"
4254
}
43-

0 commit comments

Comments
 (0)