Skip to content

Commit

Permalink
Merge pull request #3965 from DFE-Digital/833-publish-fix-docker-build
Browse files Browse the repository at this point in the history
Docker build: Update Ruby base image and Nodejs version
  • Loading branch information
johnake authored Dec 12, 2023
2 parents e18163c + cec4fd1 commit 3833fd0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ruby 3.1.0
bundler 2.3.20
yarn 1.22.4
nodejs 16.14.0
nodejs 20.10.0
terraform 1.2.3
adr-tools 3.0.0
cf 7.4.0
Expand Down
14 changes: 4 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,15 @@ RUN bundle exec middleman build --build-dir=../public

###

FROM ruby:3.1-alpine3.15

RUN echo "http://dl-cdn.alpinelinux.org/alpine/v3.15/main" > /etc/apk/repositories && \
echo "http://dl-cdn.alpinelinux.org/alpine/v3.15/community" >> /etc/apk/repositories
FROM ruby:3.1-alpine3.19

RUN apk add --update --no-cache tzdata && \
cp /usr/share/zoneinfo/Europe/London /etc/localtime && \
echo "Europe/London" > /etc/timezone

RUN apk add --update --no-cache --virtual runtime-dependances \
RUN apk add --update --no-cache \
postgresql-dev git ncurses shared-mime-info

# Remove once the base image ruby:3.1-alpine3.15 has been updated with the below pkgs
RUN apk add --no-cache ncurses=6.3_p20211120-r2 ncurses-libs=6.3_p20211120-r2 libcurl=8.4.0-r0 pkgconf=1.8.1-r0 nghttp2=1.46.0-r2 nghttp2-libs=1.46.0-r2

ENV APP_HOME /app

RUN mkdir $APP_HOME
Expand All @@ -38,12 +32,12 @@ WORKDIR $APP_HOME
ADD Gemfile $APP_HOME/Gemfile
ADD Gemfile.lock $APP_HOME/Gemfile.lock

RUN apk add --update --no-cache --virtual build-dependances \
RUN apk add --update --no-cache --virtual build-dependencies \
build-base && \
apk add --update --no-cache libpq yarn && \
bundle install --jobs=4 && \
rm -rf /usr/local/bundle/cache && \
apk del build-dependances
apk del build-dependencies

COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile && \
Expand Down
2 changes: 1 addition & 1 deletion docs/.tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
nodejs 16.14.0
nodejs 20.10.0
bundler 2.1.4
ruby 2.7.5
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "teacher-training-api",
"private": true,
"engines": {
"node": "16.x"
"node": "20.x"
},
"scripts": {
"build": "yarn run build:css && yarn run build:js",
Expand Down

0 comments on commit 3833fd0

Please sign in to comment.