Skip to content

Commit

Permalink
Add a docker-compose.yml config file to separate postgres from the re…
Browse files Browse the repository at this point in the history
…benchdb container

- switch base image to one with Node.js 21

Signed-off-by: Stefan Marr <[email protected]>
  • Loading branch information
smarr committed Jan 19, 2024
1 parent 1245e6b commit 986f094
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
13 changes: 3 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand All @@ -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
Expand Down
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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'

0 comments on commit 986f094

Please sign in to comment.