Skip to content
Snippets Groups Projects
Commit 9fba7fb7 authored by Treadway, Ross T (UG - Computer Science)'s avatar Treadway, Ross T (UG - Computer Science)
Browse files

Adding Auth Microservice

parent f85f1015
No related branches found
No related tags found
No related merge requests found
default: &default
adapter: mysql2
encoding: utf8
host: db
username: root
password: group24
# username: admin
# password: admin
development: development:
<<: *default primary:
database: docker_dev adapter: mysql2
encoding: utf8
host: db_primary
username: root
password: group24
database: docker_dev
auth:
adapter: mysql2
encoding: utf8
host: db_auth
username: root
password: group24
database: auth
port: 3307
test: test:
<<: *default primary:
database: docker_test adapter: mysql2
encoding: utf8
host: db_primary
username: root
password: group24
database: docker_dev
auth:
adapter: mysql2
encoding: utf8
host: db_auth
username: root
password: group24
database: auth
port: 3307
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rails
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2022_04_03_154638) do
create_table "users", charset: "utf8", force: :cascade do |t|
t.string "username"
t.string "firstname"
t.string "lastname"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end
end
version: "3.7" version: "3.7"
services: services:
db: db_primary:
image: mysql:5.7 image: mysql:5.7
# volumes: # volumes:
# - db_data:/var/lib/mysql # - db_data:/var/lib/mysql
restart: always restart: always
environment: environment:
# MYSQL_DATABASE: docker MYSQL_DATABASE: docker_dev
MYSQL_USER: admin MYSQL_USER: admin
MYSQL_PASSWORD: admin MYSQL_PASSWORD: admin
MYSQL_ROOT_PASSWORD: group24 MYSQL_ROOT_PASSWORD: group24
ports:
- "3306:3306"
db_auth:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: auth
MYSQL_USER: admin
MYSQL_PASSWORD: admin
MYSQL_ROOT_PASSWORD: group24
MYSQL_TCP_PORT: 3307
ports:
- "3307:3307"
web:
primary:
build: . build: .
image: webcalendar image: webcalendar
ports: ports:
- 3000:3000 - "3000:3000"
volumes: volumes:
- .:/app - .:/app
depends_on: depends_on:
- db - db_primary
links:
- db_primary
auth:
image: driftydirt/group24auth:0.0.4
ports:
- "3001:3000"
depends_on:
- db_auth
links: links:
- db - db_auth
...@@ -10,14 +10,14 @@ rm -f /tmp/pids/server.pid ...@@ -10,14 +10,14 @@ rm -f /tmp/pids/server.pid
# Check and wait for mysql container to be setup and connected # Check and wait for mysql container to be setup and connected
echo "Waiting for MySQL DB connection ..." echo "Waiting for MySQL DB connection ..."
status=$(nc -z db 3306; echo $?) status=$(nc -z db_primary 3306; echo $?)
echo $status echo $status
while [ $status != 0 ] while [ $status != 0 ]
do do
echo "Waiting 3s ..." echo "Waiting 3s ..."
sleep 3s sleep 3s
status=$(nc -z db 3306; echo $?) status=$(nc -z db_primary 3306; echo $?)
echo $status echo $status
done done
...@@ -43,6 +43,9 @@ echo "DB is up ..." ...@@ -43,6 +43,9 @@ echo "DB is up ..."
# printf "[rake db:seed]\n" # printf "[rake db:seed]\n"
# rake db:seed # rake db:seed
RAILS_ENV=development rails db:environment:set
# Reseting database (dropping previous, creating and migrating fresh db) # Reseting database (dropping previous, creating and migrating fresh db)
printf "\nResetting database ...\n" printf "\nResetting database ...\n"
printf "[db:migrate:reset] => [db:drop]-[db:create]-[db:migrate]\n" printf "[db:migrate:reset] => [db:drop]-[db:create]-[db:migrate]\n"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment