Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Dockerfile #952

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ENV NODE_ENV=production
FROM base AS builder

RUN apt-get update -qq && \
apt-get install -y build-essential libssl-dev libpq-dev git libsasl2-dev curl && \
apt-get install -y build-essential libssl-dev libpq-dev git libsasl2-dev libyaml-dev curl && \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if it's needed in both places.

Also, what about Dockerfile.dev ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Dockerfile uses a Multi-stage build strategy.
The first part of this file creates a "builder" image that is only used for setting up the app dependencies, gems, assets precompilation, etc. And the final part is actually the "runtime" image.

If the library is needed for both build and runtime, we need to add it in both places. I think this change is correct 👍

Regarding the Dockerfile.dev, it does not implement multi-stage, but if it is a runtime dependency I think we should add it there as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm -rf /var/lib/apt/lists/*

# Copy node binaries from node image.
Expand Down Expand Up @@ -58,7 +58,7 @@ FROM base

# Install packages needed for deployment
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl libpq-dev libvips libjemalloc2 && \
apt-get install --no-install-recommends -y curl libpq-dev libvips libjemalloc2 libyaml-dev && \
apt-get clean

# Create app directory.
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ FROM node:$NODE_VERSION AS node
FROM ruby:${RUBY_VERSION}-slim

RUN apt-get update -qq && \
apt-get install -y build-essential libssl-dev libpq-dev vim git libsasl2-dev curl && \
apt-get install -y build-essential libssl-dev libpq-dev vim git libsasl2-dev libyaml-dev curl && \
rm -rf /var/lib/apt/lists/*

# Copy node binaries from node image.
Expand Down
Loading