forked from immense/Remotely
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request immense#420 from fanuelsen/master
Add Dockerfile configured to not run Remotely as root
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
FROM ubuntu:focal | ||
|
||
EXPOSE 5000 | ||
|
||
ENV ASPNETCORE_ENVIRONMENT="Production" | ||
ENV ASPNETCORE_URLS="http://*:5000" | ||
|
||
RUN \ | ||
apt-get -y update && \ | ||
apt-get -y install \ | ||
apt-utils \ | ||
wget \ | ||
apt-transport-https \ | ||
unzip \ | ||
acl \ | ||
libssl1.0 | ||
|
||
RUN \ | ||
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb && \ | ||
dpkg -i packages-microsoft-prod.deb && \ | ||
apt-get -y update && \ | ||
apt-get -y install aspnetcore-runtime-5.0 | ||
|
||
RUN \ | ||
adduser --disabled-password --gecos '' -u 2001 remotely && \ | ||
mkdir -p /var/www/remotely && \ | ||
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 && \ | ||
chown -R remotely:remotely /var/www/remotely | ||
|
||
RUN \ | ||
mkdir -p /remotely-data && \ | ||
sed -i 's/DataSource=Remotely.db/DataSource=\/remotely-data\/Remotely.db/' /var/www/remotely/appsettings.json && \ | ||
chown -R remotely:remotely /remotely-data | ||
|
||
VOLUME "/remotely-data" | ||
|
||
WORKDIR /var/www/remotely | ||
|
||
COPY DockerMain.sh / | ||
|
||
RUN chmod 755 /DockerMain.sh | ||
|
||
USER remotely | ||
|
||
ENTRYPOINT ["/DockerMain.sh"] |