This commit is contained in:
Joseph.Roy 2023-12-18 14:34:27 +00:00
commit 7e78a9245a
3 changed files with 12 additions and 11 deletions

View File

@ -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

View File

@ -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"]

View File

@ -1,11 +1,12 @@
version: "3"
services:
server:
auth_server:
container_name: auth
build:
context: .
dockerfile: Dockerfile
image: auth_server
ports:
- "47706:4567"
volumes: