Skip to content

Commit

Permalink
Upgrade node and Dockerfile to get to build on Openshift (tl-its-umic…
Browse files Browse the repository at this point in the history
…h-edu#355)

* Upgrade node and Dockerfile to get to build on Openshift

Fixes tl-its-umich-edu#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 and pushyamig committed Nov 25, 2024
1 parent 6edc1df commit 73ed66a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 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
17 changes: 17 additions & 0 deletions dockerfiles/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# node-build stage

<<<<<<< HEAD:dockerfiles/Dockerfile.prod
FROM node:20-slim AS node-build
=======
FROM image-registry.openshift-image-registry.svc:5000/openshift/node:20-slim AS node-build
>>>>>>> edc346e (Upgrade node and Dockerfile to get to build on Openshift (#355)):dockerfiles/Dockerfile.openshift
WORKDIR /build/

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

# main stage

<<<<<<< HEAD:dockerfiles/Dockerfile.prod
FROM python:3.10-slim-bookworm AS main

RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential default-libmysqlclient-dev netcat-openbsd vim-tiny jq python3-dev git supervisor curl && \
=======
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 netcat-openbsd vim-tiny jq python3-dev git supervisor curl pkg-config && \
>>>>>>> edc346e (Upgrade node and Dockerfile to get to build on Openshift (#355)):dockerfiles/Dockerfile.openshift
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 73ed66a

Please sign in to comment.