Change entrypoint of dockerfile.
Use environment variables for base_uri and config file.
This commit is contained in:
parent
c1bcd47220
commit
fae15e5737
|
@ -1,2 +1,4 @@
|
||||||
/dist/*
|
/dist/*
|
||||||
/bot.z_web/node_modules/*
|
/bot.z_web/node_modules/*
|
||||||
|
/.*yaml
|
||||||
|
/.*yml
|
||||||
|
|
|
@ -11,6 +11,7 @@ COPY --from=node /opt /opt
|
||||||
COPY --from=ff /opt/firefox-latest /opt/firefox-latest
|
COPY --from=ff /opt/firefox-latest /opt/firefox-latest
|
||||||
COPY --from=ff /opt/geckodriver* /opt/
|
COPY --from=ff /opt/geckodriver* /opt/
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
COPY entrypoint.sh /srv/
|
||||||
WORKDIR /app/bot.z_web
|
WORKDIR /app/bot.z_web
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y $(apt-cache depends firefox-esr| awk '/Depends:/{print$2}') \
|
&& apt-get install -y $(apt-cache depends firefox-esr| awk '/Depends:/{print$2}') \
|
||||||
|
@ -27,5 +28,4 @@ RUN python setup.py develop
|
||||||
EXPOSE 3003
|
EXPOSE 3003
|
||||||
VOLUME ["/app/bot.z_web/node_modules"]
|
VOLUME ["/app/bot.z_web/node_modules"]
|
||||||
|
|
||||||
ENTRYPOINT ["z_app"]
|
ENTRYPOINT ["/srv/entrypoint.sh"]
|
||||||
CMD ["-a", "0.0.0.0"]
|
|
||||||
|
|
34
entrypoint.sh
Executable file
34
entrypoint.sh
Executable file
|
@ -0,0 +1,34 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
CONF="/tmp/botz.yaml"
|
||||||
|
|
||||||
|
if [ -z ${DEBUG} ]; then
|
||||||
|
_DEBUG="false"
|
||||||
|
else
|
||||||
|
_DEBUG="true"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z ${BASE_URI} ]; then
|
||||||
|
echo "Missing BASE_URI environment variable."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat > ${CONF} <<-EOF
|
||||||
|
base_uri: ${BASE_URI}
|
||||||
|
debug: ${_DEBUG}
|
||||||
|
log:
|
||||||
|
level: ${DEBUG_LEVEL:-INFO}
|
||||||
|
syslog: false
|
||||||
|
http:
|
||||||
|
bind_addr:
|
||||||
|
- "0.0.0.0"
|
||||||
|
port: 3003
|
||||||
|
EOF
|
||||||
|
|
||||||
|
echo "--------------------------------------------"
|
||||||
|
echo " STARTING WITH CONFIG:"
|
||||||
|
echo "--------------------------------------------"
|
||||||
|
cat ${CONF}
|
||||||
|
echo "--------------------------------------------"
|
||||||
|
|
||||||
|
z_app -c ${CONF}
|
Loading…
Reference in New Issue
Block a user