From 35be009fdfe9015a06dd147b25765df2fecbe542 Mon Sep 17 00:00:00 2001 From: joseph Date: Mon, 18 Dec 2023 14:18:56 +0000 Subject: [PATCH] added get request to check status --- auth/auth.rb | 6 ++++++ auth/docker/Dockerfile | 14 ++++---------- auth/docker/docker-compose.yml | 3 ++- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/auth/auth.rb b/auth/auth.rb index 2afee24..397871e 100644 --- a/auth/auth.rb +++ b/auth/auth.rb @@ -15,6 +15,12 @@ TOKEN_SECRET = ENV['JWT_SECRET_KEY'] puts TOKEN_SECRET initialize_database +get '/' do + content_type :json + + return {result: "Service up and running"}.to_json +end + post '/auth/login' do content_type :json diff --git a/auth/docker/Dockerfile b/auth/docker/Dockerfile index 7e05816..fb877f1 100644 --- a/auth/docker/Dockerfile +++ b/auth/docker/Dockerfile @@ -1,20 +1,14 @@ -# Stage 1: Build stage with git -FROM ubuntu:jammy AS GITCOPY +FROM ruby:3.2.2 -WORKDIR /roysathome +WORKDIR /roysathome/ RUN apt-get update && apt-get install -y git RUN git clone https://git.roysathome.net/joseph/roysathome.net.git . +WORKDIR ./auth + # 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 - RUN bundle install CMD ["ruby","./auth.rb"] diff --git a/auth/docker/docker-compose.yml b/auth/docker/docker-compose.yml index 5869d21..cdba7a5 100644 --- a/auth/docker/docker-compose.yml +++ b/auth/docker/docker-compose.yml @@ -1,11 +1,12 @@ version: "3" services: - server: + auth_server: container_name: auth build: context: . dockerfile: Dockerfile + image: auth_server ports: - "47706:4567" volumes: