Skip to content

Commit

Permalink
refactor: move work to subdirectory and undo changes in root
Browse files Browse the repository at this point in the history
  • Loading branch information
haydenclev committed Aug 27, 2024
1 parent 5d571a5 commit 821c331
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ yarn-debug.log*
/app/assets/builds/*
!/app/assets/builds/.keep
public/assets
sql-data
docker_migration/sql-data
16 changes: 8 additions & 8 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
gems
= require rails-ujs
// gems
//= require rails-ujs

package.json
= require corejs-typeahead/dist/typeahead.bundle.min.js
// package.json
//= require corejs-typeahead/dist/typeahead.bundle.min.js

app/assets/javascripts
= require all_pages/catalog_autocompletion
= require all_pages/reference_autocompletion
= require all_pages/global
// app/assets/javascripts
//= require all_pages/catalog_autocompletion
//= require all_pages/reference_autocompletion
//= require all_pages/global
40 changes: 20 additions & 20 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
services:
db:
image: mysql/mysql-server:latest
environment:
- MYSQL_ROOT_HOST=%
- MYSQL_ROOT_PASSWORD=password
ports:
- "3309:3306"
expose:
- "3306"
container_name: antcat-db
volumes:
- ./sql-data:/docker-entrypoint-initdb.d
version: "3"

services:
app:
depends_on:
- db
build:
context: .
dockerfile: Dockerfile
dockerfile: Dockerfile.dev
environment:
DB_USERNAME: root
DB_PASSWORD: password
DB_DATABASE: antcat
DB_DATABASE: antcat_docker
DB_PORT: 3306
DB_HOST: db
NO_DEV_MONKEY_PATCHES: "y"
volumes:
- .:/app
- ./docker_dev/database.docker-dev.yml:/app/config/database.yml
- ./config/server.yml.example:/app/config/server.yml
ports:
- "8080:8080"
container_name: antcat-app
user: antcat
stdin_open: true
tty: true
command: ["/bin/bash", "-c", "app/startup.sh"]
container_name: antcat_app


db:
image: mysql:5.7
expose:
- "3306"
ports:
- "3309:3306"
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
volumes:
- mysql:/var/lib/mysql

volumes:
mysql:
3 changes: 1 addition & 2 deletions docker_dev/database.docker-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ default: &default

development:
<<: *default
database: <%= ENV['DB_DATABASE'] %>
# database: <%= ENV['DB_DATABASE'] %>_developmment
database: <%= ENV['DB_DATABASE'] %>_development

test:
<<: *default
Expand Down
File renamed without changes.
13 changes: 13 additions & 0 deletions docker_migration/database.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
default: &default
adapter: mysql2
encoding: utf8
pool: 5
username: <%= ENV['DB_USERNAME'] %>
password: <%= ENV['DB_PASSWORD'] %>
port: <%= ENV['DB_PORT'] %>
host: <%= ENV['DB_HOST'] %>
socket: /var/run/mysqld/mysqlx.sock

development:
<<: *default
database: <%= ENV['DB_DATABASE'] %>
38 changes: 38 additions & 0 deletions docker_migration/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
services:
db:
image: mysql/mysql-server:latest
environment:
- MYSQL_ROOT_HOST=%
- MYSQL_ROOT_PASSWORD=password
ports:
- "3309:3306"
expose:
- "3306"
container_name: antcat-db
volumes:
- ./sql-data:/docker-entrypoint-initdb.d

app:
depends_on:
- db
build:
context: .
dockerfile: Dockerfile
environment:
DB_USERNAME: root
DB_PASSWORD: password
DB_DATABASE: antcat
DB_PORT: 3306
DB_HOST: db
NO_DEV_MONKEY_PATCHES: "y"
volumes:
- ..:/app
- ./database.yml:/app/config/database.yml
- ../config/server.yml.example:/app/config/server.yml
ports:
- "8080:8080"
container_name: antcat-app
user: antcat
stdin_open: true
tty: true
command: ["/bin/bash", "-c", "app/startup.sh"]
17 changes: 17 additions & 0 deletions docker_migration/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash


# Remove any pre-exisitng PID files
rm -rf /app/tmp/pids/server.pid

bundle install --path=vendor/bundle
yarn install

# Configure bundle to use a local path for gems
bundle config path vendor/bundle

# Start the Solr service for Sunspot
bundle exec rails sunspot:solr:start

# Start the Rails server, binding it to all network interfaces
bundle exec rails s -p 8080 -b '0.0.0.0'

0 comments on commit 821c331

Please sign in to comment.