Spaces:
Runtime error
Runtime error
Upload 5 files
Browse files- Dockerfile +2 -1
- start.sh +8 -12
Dockerfile
CHANGED
|
@@ -84,7 +84,8 @@ RUN chmod +x /start.sh
|
|
| 84 |
|
| 85 |
# User Setup
|
| 86 |
RUN useradd -m -u 1000 user
|
| 87 |
-
RUN
|
|
|
|
| 88 |
|
| 89 |
# Ensure PHP run directory exists and is writable
|
| 90 |
RUN mkdir -p /run/php && chown -R user:user /run/php
|
|
|
|
| 84 |
|
| 85 |
# User Setup
|
| 86 |
RUN useradd -m -u 1000 user
|
| 87 |
+
RUN mkdir -p /var/log/rabbitmq
|
| 88 |
+
RUN chown -R user:user /var/lib/postgresql /var/lib/rabbitmq /var/log/rabbitmq /var/log/libretime /etc/libretime /var/lib/libretime /srv/libretime /var/lib/nginx /var/log/nginx /var/log/supervisor /var/run/postgresql /var/log/icecast2
|
| 89 |
|
| 90 |
# Ensure PHP run directory exists and is writable
|
| 91 |
RUN mkdir -p /run/php && chown -R user:user /run/php
|
start.sh
CHANGED
|
@@ -27,23 +27,19 @@ if [ ! -s "$PG_DATA/PG_VERSION" ]; then
|
|
| 27 |
/usr/lib/postgresql/13/bin/pg_ctl -D "$PG_DATA" -w start
|
| 28 |
|
| 29 |
echo "Creating LibreTime DB and User..."
|
| 30 |
-
|
| 31 |
-
psql -h localhost -c "CREATE
|
| 32 |
-
psql -h localhost -c "
|
| 33 |
-
psql -h localhost -c "
|
|
|
|
| 34 |
|
| 35 |
echo "Stopping PG..."
|
| 36 |
/usr/lib/postgresql/13/bin/pg_ctl -D "$PG_DATA" stop
|
| 37 |
fi
|
| 38 |
|
| 39 |
-
# 3. Setup RabbitMQ
|
| 40 |
-
#
|
| 41 |
-
|
| 42 |
-
# We might need to enable plugins or set user.
|
| 43 |
-
# For simplicity, we stick to default 'guest' if localhost, but config uses 'libretime'.
|
| 44 |
-
# We need to create rabbitmq user if not exists.
|
| 45 |
-
# We'll do it in background or let it fail?
|
| 46 |
-
# Better: Start rabbitmq server detached, configure, stop.
|
| 47 |
echo "Configuring RabbitMQ..."
|
| 48 |
/usr/sbin/rabbitmq-server -detached
|
| 49 |
sleep 10
|
|
|
|
| 27 |
/usr/lib/postgresql/13/bin/pg_ctl -D "$PG_DATA" -w start
|
| 28 |
|
| 29 |
echo "Creating LibreTime DB and User..."
|
| 30 |
+
# Connect to 'postgres' db as current user (who is superuser due to initdb)
|
| 31 |
+
psql -h localhost -d postgres -c "CREATE DATABASE libretime;" || true
|
| 32 |
+
psql -h localhost -d postgres -c "CREATE USER libretime WITH PASSWORD 'libretime';" || true
|
| 33 |
+
psql -h localhost -d postgres -c "GRANT ALL PRIVILEGES ON DATABASE libretime TO libretime;" || true
|
| 34 |
+
psql -h localhost -d postgres -c "ALTER USER libretime CREATEDB;" || true
|
| 35 |
|
| 36 |
echo "Stopping PG..."
|
| 37 |
/usr/lib/postgresql/13/bin/pg_ctl -D "$PG_DATA" stop
|
| 38 |
fi
|
| 39 |
|
| 40 |
+
# 3. Setup RabbitMQ
|
| 41 |
+
# Ensure log dir exists and is writable (just in case Dockerfile missed it or volume overwrote it)
|
| 42 |
+
mkdir -p /var/log/rabbitmq
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
echo "Configuring RabbitMQ..."
|
| 44 |
/usr/sbin/rabbitmq-server -detached
|
| 45 |
sleep 10
|