mods for ansible
This commit is contained in:
parent
3621ddc190
commit
6ea1b003bd
2 changed files with 16 additions and 21 deletions
18
Dockerfile
18
Dockerfile
|
@ -5,11 +5,6 @@ RUN cd /frontend && yarn --prod && yarn build
|
||||||
|
|
||||||
FROM alpine:3.11
|
FROM alpine:3.11
|
||||||
|
|
||||||
ENV UID=1337 \
|
|
||||||
GID=1337
|
|
||||||
|
|
||||||
COPY . /opt/maubot
|
|
||||||
COPY --from=frontend-builder /frontend/build /opt/maubot/frontend
|
|
||||||
WORKDIR /opt/maubot
|
WORKDIR /opt/maubot
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
py3-aiohttp \
|
py3-aiohttp \
|
||||||
|
@ -28,10 +23,19 @@ RUN apk add --no-cache \
|
||||||
py3-jinja2 \
|
py3-jinja2 \
|
||||||
py3-click \
|
py3-click \
|
||||||
py3-packaging \
|
py3-packaging \
|
||||||
py3-markdown \
|
py3-markdown
|
||||||
&& pip3 install -r requirements.txt feedparser dateparser langdetect python-gitlab
|
|
||||||
|
COPY requirements.txt /opt/maubot/requirements.txt
|
||||||
|
|
||||||
|
RUN pip3 install -r requirements.txt feedparser dateparser langdetect python-gitlab
|
||||||
|
|
||||||
|
COPY . /opt/maubot
|
||||||
|
COPY --from=frontend-builder /frontend/build /opt/maubot/frontend
|
||||||
|
|
||||||
# TODO remove pillow, magic and feedparser when maubot supports installing dependencies
|
# TODO remove pillow, magic and feedparser when maubot supports installing dependencies
|
||||||
|
|
||||||
VOLUME /data
|
VOLUME /data
|
||||||
|
VOLUME /config
|
||||||
|
VOLUME /plugins
|
||||||
|
|
||||||
CMD ["/opt/maubot/docker/run.sh"]
|
CMD ["/opt/maubot/docker/run.sh"]
|
||||||
|
|
|
@ -1,21 +1,12 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
function fixperms {
|
|
||||||
chown -R $UID:$GID /var/log /data /opt/maubot
|
|
||||||
}
|
|
||||||
|
|
||||||
cd /opt/maubot
|
cd /opt/maubot
|
||||||
|
|
||||||
if [ ! -f /data/config.yaml ]; then
|
if [ ! -f /config/config.yaml ]; then
|
||||||
cp docker/example-config.yaml /data/config.yaml
|
echo "Config file not found."
|
||||||
mkdir -p /var/log /data/plugins /data/trash /data/dbs
|
|
||||||
echo "Config file not found. Example config copied to /data/config.yaml"
|
|
||||||
echo "Please modify the config file to your liking and restart the container."
|
|
||||||
fixperms
|
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p /var/log/maubot /data/plugins /data/trash /data/dbs
|
mkdir -p /data/trash /data/dbs
|
||||||
alembic -x config=/data/config.yaml upgrade head
|
alembic -x config=/config/config.yaml upgrade head
|
||||||
fixperms
|
python3 -m maubot -c /config/config.yaml
|
||||||
exec su-exec $UID:$GID python3 -m maubot -c /data/config.yaml -b docker/example-config.yaml
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue