Skip to content

Commit

Permalink
Added docker container persistence using volume at /data
Browse files Browse the repository at this point in the history
  • Loading branch information
DaanSelen committed Nov 21, 2024
1 parent 3fcca02 commit c8b4674
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ FROM alpine:latest
LABEL maintainer="[email protected]"

# Install Apache & Bash
RUN apk update && apk add --no-cache apache2 bash
RUN apk update \
&& apk add --no-cache apache2 bash

# Suppress the ServerName warning
RUN echo "ServerName localhost" >> /etc/apache2/httpd.conf
RUN echo "ServerName localhost" >> /etc/apache2/httpd.conf \
&& mkdir /app \
&& mkdir /data

COPY entrypoint.sh /entrypoint.sh
COPY ntos /var/www/localhost/htdocs/

EXPOSE 80
COPY ntos /app

ENTRYPOINT ["/bin/bash", "/entrypoint.sh"]
12 changes: 12 additions & 0 deletions docker/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:
ntos-server:
image: test:latest
#image: dselen/ntos-server:latest
container_name: ntos-server
restart: unless-stopped
ports:
- 8080:80/tcp
volumes:
- ntos_data:/data
volumes:
ntos_data:
11 changes: 10 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#!/bin/bash

echo "Starting NTOS-Server..."
echo "Configuring NTOS-Server..."

cp -rv /app/* /data

ln -s /data/assets /var/www/localhost/htdocs/assets
ln -s /data/configs /var/www/localhost/htdocs/configs
ln -s /data/credcon /var/www/localhost/htdocs/credcon
ln -s /data/rdp /var/www/localhost/htdocs/rdp

echo "Done. Starting Apache2 webserver..."

httpd -D FOREGROUND &

Expand Down

0 comments on commit c8b4674

Please sign in to comment.