From 67aaee9a7291863930453f48614ba3ce5e89dca8 Mon Sep 17 00:00:00 2001 From: Joseph Roy Date: Mon, 11 Dec 2023 22:35:31 +0000 Subject: [PATCH] add docker files --- auth/Gemfile | 3 ++- auth/docker_compose.yml | 12 ++++++++++++ auth/dockerfile | 22 ++++++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 auth/docker_compose.yml create mode 100644 auth/dockerfile diff --git a/auth/Gemfile b/auth/Gemfile index 8a35825..65576fa 100644 --- a/auth/Gemfile +++ b/auth/Gemfile @@ -2,7 +2,8 @@ source "https://rubygems.org" -ruby '3.2.2' +#ruby '3.2.2' +ruby '2.6.10' gem 'sinatra' gem 'webrick' diff --git a/auth/docker_compose.yml b/auth/docker_compose.yml new file mode 100644 index 0000000..2f75842 --- /dev/null +++ b/auth/docker_compose.yml @@ -0,0 +1,12 @@ +version: "3" + +services: + app: + build: + context: . + dockerfile: Dockerfile + ports: + - "4567:4567" + volumes: + - ./auth:/app # Adjust the path accordingly + command: ["./auth.rb"] diff --git a/auth/dockerfile b/auth/dockerfile new file mode 100644 index 0000000..d93b2ba --- /dev/null +++ b/auth/dockerfile @@ -0,0 +1,22 @@ +# Stage 1: Build stage with git +FROM ubuntu:jammy AS GITCOPY + +WORKDIR /roysathome + +RUN apt-get update && apt-get install -y git + +RUN git clone https://git.roysathome.net/joseph/roysathome.net.git . + +# Stage 2: Final image with Ruby +FROM ruby:3.2.2 + +# Copy files from the first stage +COPY --from=GITCOPY /roysathome/auth /app + +WORKDIR /app + +# Gemfile and Gemfile.lock are already in /usr/src/app/roysathome/auth due to the previous COPY command + +RUN bundle install + +CMD ["./auth.rb"]