Skip to content

Commit

Permalink
Best pratices Dockerfile
Browse files Browse the repository at this point in the history
Signed-off-by: Afonso Oliveira <[email protected]>
  • Loading branch information
AFOliveira committed Dec 10, 2024
1 parent 0f8f064 commit 4bb859c
Showing 1 changed file with 17 additions and 30 deletions.
47 changes: 17 additions & 30 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,25 @@
# Use Ubuntu 24.04 as base image
FROM ubuntu:24.04

ENV DEBIAN_FRONTEND=noninteractive
ENV DEVCONTAINER_ENV=1
ENV BUNDLE_PATH=/usr/local/bundle
ENV BUNDLE_APP_CONFIG=/usr/local/bundle

# Set working directory
WORKDIR /workspace

COPY Gemfile Gemfile.lock ./
RUN export DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install -y --no-install-recommends git gh
RUN apt-get install -y --no-install-recommends less
RUN apt-get install -y --no-install-recommends python3
RUN apt-get install -y --no-install-recommends python3.12-venv
RUN apt-get install -y --no-install-recommends python3-pip
RUN apt-get install -y --no-install-recommends build-essential
RUN apt-get install -y --no-install-recommends ruby
RUN apt-get install -y --no-install-recommends ruby-dev
RUN apt-get install -y --no-install-recommends bundler
RUN apt-get install -y --no-install-recommends nodejs
RUN apt-get install -y --no-install-recommends npm
RUN apt-get install -y --no-install-recommends ditaa
RUN apt-get clean autoclean
RUN apt-get autoremove -y
RUN rm -rf /var/lib/{apt,dpkg,cache,log}/*

# Install dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
gh \
less \
python3 \
python3.12-venv \
python3-pip \
build-essential \
ruby \
ruby-dev \
bundler \
nodejs \
npm \
ditaa && \
bundle install && \
apt-get clean autoclean && \
apt-get autoremove -y && \
rm -rf /var/lib/{apt,dpkg,cache,log}/*

COPY package.json package-lock.json ./

# Stay in workspace directory
WORKDIR /workspace

0 comments on commit 4bb859c

Please sign in to comment.