Skip to content

Commit

Permalink
Fix: Custom theme setup on container boot
Browse files Browse the repository at this point in the history
  • Loading branch information
pglombardo committed Dec 19, 2024
1 parent d9f53e1 commit 450093d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 38 deletions.
3 changes: 2 additions & 1 deletion containers/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ RUN apk add --no-cache \
mariadb-connector-c \
nodejs \
sqlite-dev \
tzdata
tzdata \
yarn

# Create a user and group to run the application
ARG UID=1000
Expand Down
4 changes: 1 addition & 3 deletions containers/docker/docker-compose-ephemeral.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
version: '2.1'
services:

passwordpusher:
pwpush:
image: docker.io/pglombardo/pwpush:latest
environment:
DATABASE_URL: "sqlite3:db/db.sqlite3"
Expand Down
12 changes: 5 additions & 7 deletions containers/docker/docker-compose-mariadb.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
version: '2.1'

services:
db:
image: mariadb:11.4
ports:
- "3306:3306"
environment:
MARIADB_USER: 'passwordpusher_user'
MARIADB_PASSWORD: 'passwordpusher_passwd'
MARIADB_DATABASE: 'passwordpusher_db'
MARIADB_USER: 'pwpush_user'
MARIADB_PASSWORD: 'pwpush_passwd'
MARIADB_DATABASE: 'pwpush_db'
MARIADB_RANDOM_ROOT_PASSWORD: 'yes'
volumes:
- /var/lib/pwpush-mariadb/data:/var/lib/mysql
- ./mariadb-data:/var/lib/mysql

pwpush:
image: docker.io/pglombardo/pwpush:latest
environment:
DATABASE_URL: 'mysql2://passwordpusher_user:passwordpusher_passwd@db:3306/passwordpusher_db'
DATABASE_URL: 'mysql2://pwpush_user:pwpush_passwd@db:3306/pwpush_db'
ports:
- "5100:5100"
depends_on:
Expand Down
12 changes: 5 additions & 7 deletions containers/docker/docker-compose-mysql.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
version: '2.1'

services:
db:
image: mysql:8.0.32
ports:
- "3306:3306"
environment:
MYSQL_USER: 'passwordpusher_user'
MYSQL_PASSWORD: 'passwordpusher_passwd'
MYSQL_DATABASE: 'passwordpusher_db'
MYSQL_USER: 'pwpush_user'
MYSQL_PASSWORD: 'pwpush_passwd'
MYSQL_DATABASE: 'pwpush_db'
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
volumes:
- /var/lib/pwpush-mysql/data:/var/lib/mysql
- ./mysql-data:/var/lib/mysql

pwpush:
image: docker.io/pglombardo/pwpush:latest
environment:
DATABASE_URL: 'mysql2://passwordpusher_user:passwordpusher_passwd@db:3306/passwordpusher_db'
DATABASE_URL: 'mysql2://pwpush_user:pwpush_passwd@db:3306/pwpush_db'
ports:
- "5100:5100"
depends_on:
Expand Down
22 changes: 10 additions & 12 deletions containers/docker/docker-compose-postgres.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
version: '2.1'

services:
postgres:
image: docker.io/postgres:15
db:
image: docker.io/postgres:16
volumes:
- /var/lib/postgresql/data:/var/lib/postgresql/data
- ./postgres-data:/var/lib/postgresql/data
ports:
- "5432:5432"
environment:
POSTGRES_USER: passwordpusher_user
POSTGRES_PASSWORD: passwordpusher_passwd
POSTGRES_DB: passwordpusher_db
POSTGRES_USER: pwpush_user
POSTGRES_PASSWORD: pwpush_passwd
POSTGRES_DB: pwpush_db

passwordpusher:
pwpush:
image: docker.io/pglombardo/pwpush:latest
environment:
DATABASE_URL: 'postgres://passwordpusher_user:passwordpusher_passwd@postgres:5432/passwordpusher_db'
DATABASE_URL: 'postgres://pwpush_user:pwpush_passwd@db:5432/pwpush_db'
ports:
- "5100:5100"
depends_on:
- postgres
- db
links:
- postgres:postgres
- db:db
#
# You can set environment variables here, or in a .env file. See:
# https://docs.docker.com/compose/environment-variables/
Expand Down
10 changes: 2 additions & 8 deletions containers/docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,11 @@ echo ""
echo "Password Pusher: migrating database to latest..."
bundle exec rake db:migrate

if [ "$PWP_PRECOMPILE" == "true" ]
then
echo "Password Pusher: precompiling assets for customisations..."
if [ -n "$PWP__THEME" ] || [ -n "$PWP_PRECOMPILE" ]; then
echo "Password Pusher: precompiling assets for customizations..."
bundle exec rails assets:precompile
fi

if [ -n "$PWP__THEME" ]; then
echo "Password Pusher: Rebuilding CSS for custom theme..."
yarn build:css
fi

echo "Password Pusher: starting puma webserver..."
bundle exec puma -C config/puma.rb

Expand Down

0 comments on commit 450093d

Please sign in to comment.