Skip to content

Commit

Permalink
Upgrade node and Dockerfile to get to build on Openshift (#355)
Browse files Browse the repository at this point in the history
* Upgrade node and Dockerfile to get to build on Openshift

Fixes #354
The 3.10-slim is the same as 3.10-slim-bookworm, but this one exists in
Openshift

* Update to match Dockerfile for recent changes

* Remove unneeded mysql
  • Loading branch information
jonespm authored Nov 14, 2024
1 parent fcc508b commit edc346e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
5 changes: 2 additions & 3 deletions dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# FROM directive instructing base image to build upon
# This could be used as a base instead:
# https://hub.docker.com/r/nikolaik/python-nodejs
FROM python:3.10-slim-bookworm
FROM python:3.10-slim

# NOTE: requirements.txt not likely to change between dev builds
COPY requirements.txt .
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
default-libmysqlclient-dev \
netcat-openbsd \
vim-tiny \
jq \
Expand All @@ -30,7 +29,7 @@ RUN pip install --no-cache-dir -r requirements.txt

WORKDIR /code/frontend

RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt install -y nodejs

COPY /frontend/package*.json /code/frontend
Expand Down
11 changes: 8 additions & 3 deletions dockerfiles/Dockerfile.openshift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# node-build stage

FROM docker-registry.default.svc:5000/openshift/node:16-slim AS node-build
FROM image-registry.openshift-image-registry.svc:5000/openshift/node:20-slim AS node-build
WORKDIR /build/

COPY frontend .
Expand All @@ -10,15 +10,20 @@ RUN npm run build:frontend

# main stage

FROM docker-registry.default.svc:5000/openshift/python:3.8-slim AS main
FROM image-registry.openshift-image-registry.svc:5000/openshift/python:3.10-slim AS main

RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential default-libmysqlclient-dev netcat vim-tiny jq python3-dev git supervisor curl && \
build-essential netcat-openbsd vim-tiny jq python3-dev git supervisor curl pkg-config && \
apt-get upgrade -y && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*

# Install MariaDB from the mariadb repository rather than using Debians
# https://mariadb.com/kb/en/mariadb-package-repository-setup-and-usage/
RUN curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | bash && \
apt install -y --no-install-recommends libmariadb-dev

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

Expand Down

0 comments on commit edc346e

Please sign in to comment.