2017-09-25 13:19:18 +02:00
|
|
|
FROM alpine:edge
|
2017-03-13 11:19:01 +01:00
|
|
|
|
2017-03-17 21:32:53 +01:00
|
|
|
ENV LANG C.UTF-8
|
|
|
|
ENV SSL_CERT_FILE /etc/ssl/certs/ca-certificates.crt
|
2017-09-05 22:17:49 +02:00
|
|
|
|
2017-03-17 21:32:53 +01:00
|
|
|
ENV BLOG_UID 1000
|
|
|
|
ENV BLOG_GID 1000
|
2017-03-13 11:19:01 +01:00
|
|
|
|
2017-09-05 22:17:49 +02:00
|
|
|
# prepare repositories
|
|
|
|
RUN set -ex \
|
|
|
|
&& echo "http://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
|
|
|
|
&& apk update
|
|
|
|
|
|
|
|
# add files
|
2017-03-13 11:19:01 +01:00
|
|
|
ADD root /
|
|
|
|
|
2017-09-05 22:17:49 +02:00
|
|
|
# prepare for provisioning
|
2017-03-13 11:19:01 +01:00
|
|
|
RUN set -ex \
|
2018-01-22 12:01:05 +01:00
|
|
|
&& apk upgrade -a --no-cache \
|
|
|
|
&& apk add --no-cache\
|
2017-03-13 11:19:01 +01:00
|
|
|
ansible \
|
|
|
|
bash \
|
2017-03-17 21:32:53 +01:00
|
|
|
ca-certificates \
|
2017-03-13 11:19:01 +01:00
|
|
|
g++ \
|
2017-03-17 21:32:53 +01:00
|
|
|
git \
|
2017-03-13 11:19:01 +01:00
|
|
|
openssh \
|
|
|
|
python \
|
|
|
|
sudo \
|
|
|
|
&& addgroup -g $BLOG_GID blog \
|
|
|
|
&& adduser -h /home/blog -D -s /bin/sh -G blog blog \
|
|
|
|
&& echo 'blog ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/blog \
|
|
|
|
&& chmod 0440 /etc/sudoers.d/blog \
|
|
|
|
&& chown -R $BLOG_UID:$BLOG_GID /home/blog
|
|
|
|
|
2017-09-05 22:17:49 +02:00
|
|
|
# switch user to blog
|
2017-03-13 11:19:01 +01:00
|
|
|
USER blog
|
|
|
|
|
2017-09-05 22:17:49 +02:00
|
|
|
# provision
|
2017-03-13 11:19:01 +01:00
|
|
|
RUN set -ex \
|
2017-03-17 21:32:53 +01:00
|
|
|
&& git clone https://github.com/xsteadfastx/batcave.git ~/.batcave \
|
2018-01-22 12:01:05 +01:00
|
|
|
&& touch ~/.profile \
|
2017-10-04 12:05:49 +02:00
|
|
|
&& ansible-playbook -i ~/.batcave/hosts ~/.batcave/shell.yml -c local --extra-vars="host=127.0.0.1" \
|
2017-09-06 13:45:59 +02:00
|
|
|
&& ansible-playbook -c local /home/blog/playbooks/writing_env.yml
|
2017-09-05 22:17:49 +02:00
|
|
|
|
2017-05-23 11:26:00 +02:00
|
|
|
EXPOSE 8000
|