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

Upgrade node and Dockerfile to get to build on Openshift #355

Merged
merged 3 commits into from
Nov 14, 2024
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
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

jonespm marked this conversation as resolved.
Show resolved Hide resolved
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