mirror of
https://github.com/paradoxxxzero/butterfly.git
synced 2026-05-26 07:08:08 +00:00
Do @thaJeztah container efficiency suggestions
This commit is contained in:
18
Dockerfile
18
Dockerfile
@@ -1,17 +1,25 @@
|
||||
FROM ubuntu:14.04.4
|
||||
|
||||
RUN apt-get update -y
|
||||
RUN apt-get install -y python-setuptools python-dev build-essential libffi-dev libssl-dev
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y -q --no-install-recommends \
|
||||
build-essential \
|
||||
libffi-dev \
|
||||
libssl-dev \
|
||||
python-dev \
|
||||
python-setuptools \
|
||||
&& apt-get clean \
|
||||
&& rm -r /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /opt
|
||||
ADD . /opt/app
|
||||
WORKDIR /opt/app
|
||||
|
||||
RUN python setup.py build
|
||||
RUN python setup.py install
|
||||
RUN python setup.py build \
|
||||
&& python setup.py install
|
||||
|
||||
ADD docker/run.sh /opt/run.sh
|
||||
|
||||
EXPOSE 57575
|
||||
|
||||
ENTRYPOINT ["/opt/run.sh"]
|
||||
CMD ["butterfly.server.py", "--unsecure", "--host=0.0.0.0"]
|
||||
ENTRYPOINT ["docker/run.sh"]
|
||||
|
||||
@@ -114,7 +114,7 @@ Starting with login and password
|
||||
docker run \
|
||||
--env PASSWORD=password \
|
||||
-p 57575:57575 \
|
||||
-d garland/butterfly --unsecure --host=0.0.0.0 --port=57575 --login
|
||||
-d garland/butterfly --port=57575 --login
|
||||
```
|
||||
|
||||
Starting with no password
|
||||
@@ -123,5 +123,5 @@ Starting with no password
|
||||
docker run \
|
||||
--env PORT=57575 \
|
||||
-p 57575:57575 \
|
||||
-d garland/butterfly --unsecure --host=0.0.0.0 --port=57575
|
||||
-d garland/butterfly --port=57575
|
||||
```
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
#!/bin/sh -x
|
||||
#!/bin/bash -e
|
||||
|
||||
# if command starts with an option, prepend the default command and options
|
||||
if [ "${1:0:1}" = '-' ]; then
|
||||
set -- butterfly.server.py --unsecure --host=0.0.0.0 --port=${PORT:-57575} "$@"
|
||||
elif [ "$1" = 'butterfly.server.py' ]; then
|
||||
shift
|
||||
set -- butterfly.server.py --unsecure --host=0.0.0.0 --port=${PORT:-57575} "$@"
|
||||
fi
|
||||
|
||||
# Set password
|
||||
echo "root:${PASSWORD}" | chpasswd
|
||||
echo "root:${PASSWORD:-password}" | chpasswd
|
||||
|
||||
/opt/app/butterfly.server.py $@
|
||||
exec "$@"
|
||||
|
||||
Reference in New Issue
Block a user