Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit 0f11700

Browse files
crswtytextbook
authored andcommitted
Switch image base to alpine
Using alpine rather than the default ubuntu massively reduces the number of CVEs in the final container and reduces the image size
1 parent 11118f2 commit 0f11700

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

Dockerfile

+16-8
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ WORKDIR /web
3636
RUN npm ci
3737
RUN npm run build
3838

39-
FROM ruby:2.6.3
39+
FROM ruby:2.6.3-alpine
4040
RUN gem install bundler:2.0.1
4141

4242
COPY ./api /postfacto
@@ -46,9 +46,22 @@ COPY --from=front-end /web/build /postfacto/client/
4646

4747
WORKDIR /postfacto
4848

49+
# Nokogiri dependencies
50+
RUN apk add --update \
51+
build-base \
52+
libxml2-dev \
53+
libxslt-dev
54+
55+
RUN apk add --update \
56+
mariadb-dev \
57+
postgresql-dev \
58+
sqlite-dev
59+
60+
RUN apk add --update nodejs
61+
62+
RUN bundle config build.nokogiri --use-system-libraries
4963
RUN bundle install --without test
50-
RUN apt-get update -qq
51-
RUN apt-get install -y nodejs
64+
5265
RUN bundle exec rake assets:precompile
5366

5467
ENV RAILS_ENV production
@@ -60,8 +73,3 @@ EXPOSE 3000
6073

6174
ENTRYPOINT "/entrypoint"
6275

63-
64-
65-
66-
67-

deployment/helm/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type: application
4444

4545
# This is the chart version. This version number should be incremented each time you make changes
4646
# to the chart and its templates, including the app version.
47-
version: 0.1.0-beta
47+
version: 0.2.0-beta
4848

4949
# This is the version number of the application being deployed. This version number should be
5050
# incremented each time you make changes to the application.

0 commit comments

Comments
 (0)