Merge pull request #3 from nickandrew/local-fixes

Some fixes and improvements. Thanks you @nickandrew !
This commit is contained in:
Glenn Y. Rolland 2016-04-26 17:46:50 +02:00
commit 86ad8cce3e
4 changed files with 10 additions and 17 deletions

View file

@ -6,7 +6,7 @@ RUN apt-get update
# Install supervisor for managing services # Install supervisor for managing services
RUN apt-get install -q -y supervisor cron openssh-server pwgen reprepro screen vim-tiny sudo nginx RUN apt-get install -q -y supervisor cron openssh-server pwgen reprepro screen vim-tiny nginx
# Configure cron # Configure cron
@ -31,10 +31,8 @@ RUN echo "daemon off;" >> /etc/nginx/nginx.conf
RUN rm -f /etc/nginx/sites-enabled/default RUN rm -f /etc/nginx/sites-enabled/default
ADD configs/nginx-default.conf /etc/nginx/sites-enabled/default ADD configs/nginx-default.conf /etc/nginx/sites-enabled/default
# Setup root & sudo access # Setup root access
RUN echo "root:docker" | chpasswd RUN echo "root:docker" | chpasswd
RUN echo %sudo ALL=NOPASSWD: ALL >> /etc/sudoers
# Configure supervisor # Configure supervisor
RUN service supervisor stop RUN service supervisor stop
@ -49,9 +47,8 @@ ENV DEBIAN_FRONTEND newt
ADD scripts/start.sh /usr/local/sbin/start ADD scripts/start.sh /usr/local/sbin/start
RUN chmod 755 /usr/local/sbin/start RUN chmod 755 /usr/local/sbin/start
VOLUME ["/docker/keys", "/docker/incoming"] VOLUME ["/docker/keys", "/docker/incoming", "/repository"]
EXPOSE 80 EXPOSE 80
EXPOSE 22 EXPOSE 22
CMD ["/usr/local/sbin/start"] CMD ["/usr/local/sbin/start"]

View file

@ -2,7 +2,7 @@ server {
listen 80 default_server; listen 80 default_server;
listen [::]:80 default_server ipv6only=on; listen [::]:80 default_server ipv6only=on;
root /var/www; root /repository/debian;
index index.html index.htm; index index.html index.htm;
# Make site accessible from http://localhost/ # Make site accessible from http://localhost/

View file

@ -2,7 +2,7 @@
BASEDIR=/var/lib/reprepro BASEDIR=/var/lib/reprepro
INCOMING=/docker/incoming INCOMING=/docker/incoming
OUTDIR=/var/www/debian OUTDIR=/repository/debian
# #
# Make sure we're in the apt/ directory # Make sure we're in the apt/ directory

View file

@ -8,7 +8,7 @@
# let's create a user to SSH into # let's create a user to SSH into
SSH_USERPASS=`pwgen -c -n -1 8` SSH_USERPASS=`pwgen -c -n -1 8`
mkdir /home/user mkdir /home/user
useradd -G sudo -d /home/user -s /bin/bash user useradd -d /home/user -s /bin/bash user
chown -R user /home/user chown -R user /home/user
chown -R user /docker/incoming chown -R user /docker/incoming
@ -25,16 +25,12 @@ for key in /docker/keys/*.pub ; do
done done
chown -R user /home/user/.ssh chown -R user /home/user/.ssh
# load cron # load crontab for root
CRONFILE=`mktemp` crontab <<EOF
cat > $CRONFILE <<EOF * * * * * /usr/local/sbin/reprepro-import >> /var/log/reprepro.log
* * * * * reprepro-import >> /var/log/reprepro.log
EOF EOF
crontab -u root $CRONFILE
rm -f $CRONFILE
# run import once, to create the right directory structure # run import once, to create the right directory structure
reprepro-import /usr/local/sbin/reprepro-import
supervisord -n supervisord -n