Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
baldarn committed Jan 14, 2025
1 parent 6032e9d commit eb4d67b
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 103 deletions.
49 changes: 0 additions & 49 deletions Dockerfile.development

This file was deleted.

10 changes: 8 additions & 2 deletions bin/docker-entrypoint
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
#!/bin/bash -e

# Enable jemalloc for reduced memory usage and latency.
if [ -f /usr/lib/*/libjemalloc.so.2 ]; then
export LD_PRELOAD="$(echo /usr/lib/*/libjemalloc.so.2) $LD_PRELOAD"
if [ -z "${LD_PRELOAD+x}" ]; then
LD_PRELOAD=$(find /usr/lib -name libjemalloc.so.2 -print -quit)
export LD_PRELOAD
fi

# If running the rails server then create or migrate existing database
if [ "${@: -2:1}" == "./bin/rails" ] && [ "${@: -1:1}" == "server" ]; then
./bin/rails db:prepare
fi

exec "${@}"
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
module OpenGas
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.2
config.load_defaults 8.0

# Please, add to the `ignore` list any other `lib` subdirectories that do
# not contain `.rb` files, or that should not be reloaded or eager loaded.
Expand Down
59 changes: 43 additions & 16 deletions config/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ image: baldarn/open-gas
# Deploy to these servers.
servers:
web:
hosts:
- opengas.eu
options:
add-host: host.docker.internal:host-gateway

# Enable SSL auto certification via Let's Encrypt (and allow for multiple apps on one server).
# Set ssl: false if using something like Cloudflare to terminate SSL (but keep host!).
- opengas.eu
# job:
# hosts:
# - 192.168.0.1
# cmd: bin/jobs

# Enable SSL auto certification via Let's Encrypt and allow for multiple apps on a single web server.
# Remove this section when using multiple web servers and ensure you terminate SSL at your load balancer.
#
# Note: If using Cloudflare, set encryption mode in SSL/TLS setting to "Full" to enable CF-to-app encryption.
proxy:
ssl: true
host: opengas.eu
Expand All @@ -24,15 +27,16 @@ registry:
server: ghcr.io
username: baldarn

# Always use an access token ratherg than real password when possible.
# Always use an access token rather than real password when possible.
password:
- KAMAL_REGISTRY_PASSWORD

# Inject ENV variables into containers (secrets come from .env).
# Remember to run `kamal env push` after making changes!
# Inject ENV variables into containers (secrets come from .kamal/secrets).
env:
secret:
- RAILS_MASTER_KEY
- APP_VERSION
clear:
APP_HOST: opengas.eu
# Run the Solid Queue Supervisor inside the web server's Puma process to do jobs.
# When you start using multiple servers, you should split out job processing to a dedicated machine.
SOLID_QUEUE_IN_PUMA: true
Expand All @@ -43,13 +47,13 @@ env:
# Set number of cores available to the application on each server (default: 1).
# WEB_CONCURRENCY: 2

# Match this to any external database server to configure Active Record correctly
# Use open-gas-db for a db accessory server on same machine via local kamal docker network.
# DB_HOST: 192.168.0.2

# Log everything from Rails
# RAILS_LOG_LEVEL: debug

secret:
- RAILS_MASTER_KEY
- APP_VERSION

# Aliases are triggered with "bin/kamal <alias>". You can overwrite arguments on invocation:
# "bin/kamal logs -r job" will tail logs from the first server in the job section.
aliases:
Expand All @@ -64,10 +68,11 @@ aliases:
volumes:
- "open_gas_storage:/rails/storage"


# Bridge fingerprinted assets, like JS and CSS, between versions to avoid
# hitting 404 on in-flight requests. Combines all files from new and old
# version inside the asset_path.
asset_path: /rails/public/assets
# asset_path: /rails/public/assets

# Configure the image builder.
builder:
Expand All @@ -89,3 +94,25 @@ ssh:
# user: app

# Use accessory services (secrets come from .kamal/secrets).
# accessories:
# db:
# image: mysql:8.0
# host: 192.168.0.2
# # Change to 3306 to expose port to the world instead of just local network.
# port: "127.0.0.1:3306:3306"
# env:
# clear:
# MYSQL_ROOT_HOST: '%'
# secret:
# - MYSQL_ROOT_PASSWORD
# files:
# - config/mysql/production.cnf:/etc/mysql/my.cnf
# - db/production.sql:/docker-entrypoint-initdb.d/setup.sql
# directories:
# - data:/var/lib/mysql
# redis:
# image: redis:7.0
# host: 192.168.0.2
# port: 6379
# directories:
# - data:/data
15 changes: 0 additions & 15 deletions config/initializers/permissions_policy.rb

This file was deleted.

20 changes: 0 additions & 20 deletions config/initializers/sqlite3.rb

This file was deleted.

0 comments on commit eb4d67b

Please sign in to comment.