You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.1 KiB
56 lines
1.1 KiB
###
|
|
### Build Variables
|
|
###
|
|
FROM localhost/debian:latest
|
|
|
|
# deploy options
|
|
# -p (port) and -v (volume) both go host:container
|
|
LABEL config_default="\
|
|
-p 9045:445 \
|
|
-v /srv/vol/samba/data:/vol/data \
|
|
-v /srv/vol/samba/media:/vol/media \
|
|
-v /srv/vol/samba/files:/vol/files"
|
|
|
|
# uid that the files owner user should have
|
|
ARG FILESUID=5000
|
|
|
|
###
|
|
### General Setup
|
|
###
|
|
|
|
# install packages we want
|
|
RUN apt update -y && apt install -y samba
|
|
|
|
# create gitea user with file owner UID
|
|
RUN addgroup --gid $FILESUID files && \
|
|
adduser files --ingroup files --uid $FILESUID --disabled-password --gecos "Files Owner" --shell /usr/sbin/nologin --no-create-home
|
|
|
|
RUN mkdir /vol && chown -R files:files /vol
|
|
|
|
# copy our custom scripts
|
|
COPY assets/bin/ /usr/local/bin/
|
|
|
|
RUN ls -A /home
|
|
|
|
# replace home with symlink
|
|
RUN cd / && rmdir home && ln -s /vol/files home
|
|
|
|
###
|
|
### NMBD
|
|
###
|
|
|
|
# disable NMBD
|
|
RUN systemctl disable nmbd
|
|
|
|
###
|
|
### SMBD
|
|
###
|
|
|
|
# copy samba config
|
|
COPY assets/smb.conf /etc/samba/smb.conf
|
|
|
|
# copy db-load service
|
|
COPY assets/db-load.service /etc/systemd/system/
|
|
|
|
# enable db-load service
|
|
RUN systemctl enable db-load.service
|
|
|