mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Automatically use Docker volume for persisting SQLite DB and appsettings.json.
This commit is contained in:
parent
20469a16aa
commit
2d104a579b
23
Server/DockerMain.sh
Normal file
23
Server/DockerMain.sh
Normal file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Entered main script."
|
||||
|
||||
ServerDir=/var/www/remotely
|
||||
RemotelyData=/remotely-data
|
||||
|
||||
AppSettingsVolume=/remotely-data/appsettings.json
|
||||
AppSettingsWww=/var/www/remotely/appsettings.json
|
||||
|
||||
if [ ! -f "$AppSettingsVolume" ]; then
|
||||
echo "Copying appsettings.json to volume."
|
||||
cp "$AppSettingsWww" "$AppSettingsVolume"
|
||||
fi
|
||||
|
||||
if [ -f "$AppSettingsWww" ]; then
|
||||
rm "$AppSettingsWww"
|
||||
fi
|
||||
|
||||
ln -s "$AppSettingsVolume" "$AppSettingsWww"
|
||||
|
||||
echo "Starting Remotely server."
|
||||
exec /usr/bin/dotnet /var/www/remotely/Remotely_Server.dll
|
||||
@ -5,7 +5,6 @@ EXPOSE 5000
|
||||
ENV ASPNETCORE_ENVIRONMENT="Production"
|
||||
ENV ASPNETCORE_URLS="http://*:5000"
|
||||
|
||||
|
||||
RUN \
|
||||
apt-get -y update && \
|
||||
apt-get -y install \
|
||||
@ -27,9 +26,16 @@ RUN \
|
||||
mkdir /config && \
|
||||
wget -q https://github.com/lucent-sea/Remotely/releases/latest/download/Remotely_Server_Linux-x64.zip && \
|
||||
unzip -o Remotely_Server_Linux-x64.zip -d /var/www/remotely && \
|
||||
rm Remotely_Server_Linux-x64.zip && \
|
||||
setfacl -R -m u:www-data:rwx /var/www/remotely && \
|
||||
chown -R www-data:www-data /var/www/remotely
|
||||
rm Remotely_Server_Linux-x64.zip
|
||||
|
||||
RUN \
|
||||
mkdir -p /remotely-data && \
|
||||
sed -i 's/DataSource=Remotely.db/DataSource=\/remotely-data\/Remotely.db/' /var/www/remotely/appsettings.json
|
||||
|
||||
VOLUME "/remotely-data"
|
||||
|
||||
WORKDIR /var/www/remotely
|
||||
ENTRYPOINT ["/usr/bin/dotnet", "/var/www/remotely/Remotely_Server.dll"]
|
||||
|
||||
COPY DockerMain.sh /
|
||||
|
||||
ENTRYPOINT ["/DockerMain.sh"]
|
||||
Loading…
Reference in New Issue
Block a user