From 986f09447f59e93e3cd5482b2d758221de6c1c24 Mon Sep 17 00:00:00 2001 From: Stefan Marr Date: Sun, 4 Jun 2023 17:43:11 +0100 Subject: [PATCH] Add a docker-compose.yml config file to separate postgres from the rebenchdb container - switch base image to one with Node.js 21 Signed-off-by: Stefan Marr --- Dockerfile | 13 +++---------- docker-compose.yml | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile index 2e78b34d..46321dc9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,17 @@ -FROM postgres:16-bookworm +FROM node:21-bookworm # this allows the setup to ignore all of the ubuntu OS setup # thats not needed for this docker image (Time Zone for example) ARG DEBIAN_FRONTEND=noninteractive # tools needed for docker setup -RUN apt-get update && apt-get install -y apt-utils curl bash sudo +RUN apt-get update && apt-get install -y apt-utils bash sudo ENV TZ=UTC RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone -# Add Node.js repo -RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - - # Node.js, PostgreSQL, headers for R packages RUN apt-get update && apt-get install -y \ - build-essential nodejs unzip \ + build-essential unzip \ libfontconfig1-dev \ libpq-dev @@ -26,9 +23,6 @@ WORKDIR /project/ RUN SKIP_COMPILE=true npm ci --ignore-scripts=false --foreground-scripts -ENV POSTGRES_PASSWORD=docker -ENV POSTGRES_USER=docker - # Basic Configuration ENV RDB_USER=docker ENV RDB_PASS=docker @@ -40,7 +34,6 @@ EXPOSE 33333 # Generate Script to start the image RUN echo 'echo Starting ReBenchDB\n\ -docker-entrypoint.sh postgres &\n\ DEV=true npm run start' > ./start-server.sh # all of the project files will be copyed to a new dir called project diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..edd13738 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +services: + rebenchdb-app: + build: Dockerfile + image: rebenchdb-app + expose: + - '33333' + postgres: + image: postgres:16-apline + environment: + POSTGRES_USER: docker + POSTGRES_PASSWORD: docker + POSTGRES_DB: rebenchdb + ports: + - '5432:5432'