diff --git a/auth/auth.rb b/auth/auth.rb index a659f4b..c11b38d 100644 --- a/auth/auth.rb +++ b/auth/auth.rb @@ -17,6 +17,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: