Skip to content

Commit 8cab64e

Browse files
committed
Switch to Alpine for smaller image
1 parent a8ef472 commit 8cab64e

1 file changed

Lines changed: 11 additions & 16 deletions

File tree

backend/Dockerfile.sandbox

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,20 @@
11
# =============================================================================
2-
# Hardened Neovim + Tmux Sandbox Container
2+
# Hardened Neovim + Tmux Sandbox Container (Alpine - lightweight)
33
# =============================================================================
4-
FROM ubuntu:24.04 AS base
5-
6-
# Prevent interactive prompts
7-
ENV DEBIAN_FRONTEND=noninteractive
4+
FROM alpine:3.20
85

96
# Install only what's needed
10-
RUN apt-get update && apt-get install -y --no-install-recommends \
7+
RUN apk add --no-cache \
118
neovim \
129
tmux \
1310
git \
1411
curl \
15-
ca-certificates \
16-
locales \
17-
&& rm -rf /var/lib/apt/lists/* \
18-
&& apt-get clean
19-
20-
# Set locale
21-
RUN locale-gen en_US.UTF-8
22-
ENV LANG=en_US.UTF-8
23-
ENV LC_ALL=en_US.UTF-8
12+
bash \
13+
ncurses \
14+
&& rm -rf /var/cache/apk/*
2415

2516
# Create non-root user
26-
RUN useradd -m -s /bin/bash -u 1000 learner
17+
RUN adduser -D -s /bin/bash -u 1000 learner
2718

2819
# Setup practice directory with sample files
2920
RUN mkdir -p /home/learner/practice && \
@@ -41,6 +32,10 @@ COPY --chown=learner:learner containers/nvim-config/ /home/learner/.config/nvim/
4132
# Basic tmux config for learning
4233
COPY --chown=learner:learner containers/tmux.conf /home/learner/.tmux.conf
4334

35+
# Set environment
36+
ENV TERM=xterm-256color
37+
ENV LANG=C.UTF-8
38+
4439
# Set working directory
4540
WORKDIR /home/learner/practice
4641

0 commit comments

Comments
 (0)