sentenz / convention

General articles, conventions, and guides.
https://sentenz.github.io/convention/
Apache License 2.0
4 stars 2 forks source link

Dockerfile #346

Closed sentenz closed 4 months ago

sentenz commented 4 months ago

Here is the refined Dockerfile applying best practices and principles:

# Use the official Debian image as the base image
FROM debian:stable-slim

# Set non-interactive frontend for debconf to avoid interactive prompts
ENV DEBIAN_FRONTEND=noninteractive

# Update the package list and install necessary packages
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    build-essential \
    curl \
    git \
    vim \
    && apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Set the working directory
WORKDIR /workspace

# Copy the local project files into the container's workspace
COPY . /workspace

# Run the make bootstrap command to set up the development environment
RUN make bootstrap

# Set the default command to run when the container starts
CMD ["bash"]

Best Practices Applied:

Make sure to review the make bootstrap command to see if it's necessary to keep the package installation commands in the Dockerfile or if they can be removed to avoid redundancy.