Własny serwer supla - od czego zacząć

Awatar użytkownika
lesny8
Posty: 1540
Rejestracja: pn gru 11, 2017 9:43 pm

śr sty 06, 2021 6:23 pm

home pisze:
śr sty 06, 2021 4:55 pm
...

Kod: Zaznacz cały

    image: image: i386/mariadb:5.5
...
Widzisz różnice ;)

Kod: Zaznacz cały

    image: i386/mariadb:5.5
home
Posty: 25
Rejestracja: pn gru 28, 2020 12:36 pm

śr sty 06, 2021 7:57 pm

tak widzę, poprawiłem na:
image: i386/mariadb:5.5 i wyskakuje błąd,
próbowałem tez na:
image: image: i386/mariadb:5.5 oraz na image: image:i386/mariadb:5.5 z ciekawości i nadal wyskakują te blędy.
Awatar użytkownika
lesny8
Posty: 1540
Rejestracja: pn gru 11, 2017 9:43 pm

śr sty 06, 2021 9:34 pm

Dodałeś użytkownika do grupy docker? Teraz zauważyłem, że cały czas używasz sudo.
Jeśli nie to to zrób

Kod: Zaznacz cały

sudo usermod -aG docker serwer
Wyloguj się i zaloguj ponownie

Sprawdź wersje, jeśli dostaniesz odpowiedź to użytkownik jest w grupie docker

Kod: Zaznacz cały

docker -v
docker-compose -v

Przejdź do katalogu i wycofaj wprowadzone zmiany

Kod: Zaznacz cały

cd ~/supla-docker
git reset --hard
Zmień obraz wykonując poniższe polecenie, nie edytuj pliku ręcznie

Kod: Zaznacz cały

sed -i "s#mysql:5.7.20#i386/mariadb:5.5#g" docker-compose.yml
Uruchom skrypt bez sudo

Kod: Zaznacz cały

./supla.sh start
home
Posty: 25
Rejestracja: pn gru 28, 2020 12:36 pm

czw sty 07, 2021 6:24 am

tak zrobiłem, dodałem usera do dockera, zmieniłem obraz poleceniem plik wygląda tak:
/home/serwer/supla-docker/docker-compose.yml

version: '3.4'

services:
supla-cloud:
container_name: ${COMPOSE_PROJECT_NAME}-cloud
restart: unless-stopped
build:
context: ./cloud
target: supla_cloud_prod
env_file:
- .env.default
- .env
volumes:
- ./ssl/cloud:/etc/apache2/ssl:z
- ${VOLUME_DATA}/cloud-local:/var/www/cloud/var/local
- ${VOLUME_DATA}/cloud-logs:/var/www/cloud/var/logs
- supla-server-socket:/supla-server:z
logging:
options:
max-size: 50m
links:
- supla-db
depends_on:
- supla-db

supla-db:
container_name: ${COMPOSE_PROJECT_NAME}-db
restart: unless-stopped
image: i386/mariadb:5.5
env_file:
- .env.default
- .env
environment:
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_DATABASE: supla
MYSQL_USER: supla
MYSQL_PASSWORD: ${DB_PASSWORD}
volumes:
- ${VOLUME_DATA}/mysql:/var/lib/mysql:z
- ./db:/etc/mysql/conf.d
logging:
options:
max-size: 50m

supla-server:
container_name: ${COMPOSE_PROJECT_NAME}-server
restart: unless-stopped
build: ./server
env_file:
- .env.default
- .env
volumes:
- ./ssl/server:/etc/supla-server/ssl:z
- supla-server-socket:/var/run/supla:z
ports:
....................................................................................
Nadal wyskakuje błąd:

serwer@linux:~$ sudo ./supla-docker/supla.sh start
Starting SUPLA containers
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 354, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3.7/http/client.py", line 1244, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.7/http/client.py", line 1290, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.7/http/client.py", line 1239, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.7/http/client.py", line 1026, in _send_output
self.send(msg)
File "/usr/lib/python3.7/http/client.py", line 966, in send
self.connect()
File "/usr/local/lib/python3.7/dist-packages/docker/transport/unixconn.py", line 43, in connect
sock.connect(self.unix_socket)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 367, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/lib/python3/dist-packages/six.py", line 692, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 354, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3.7/http/client.py", line 1244, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.7/http/client.py", line 1290, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.7/http/client.py", line 1239, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.7/http/client.py", line 1026, in _send_output
self.send(msg)
File "/usr/lib/python3.7/http/client.py", line 966, in send
self.connect()
File "/usr/local/lib/python3.7/dist-packages/docker/transport/unixconn.py", line 43, in connect
sock.connect(self.unix_socket)
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionRefusedError(111, 'Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/docker/api/client.py", line 214, in _retrieve_server_version
return self.version(api_version=False)["ApiVersion"]
File "/usr/local/lib/python3.7/dist-packages/docker/api/daemon.py", line 181, in version
return self._result(self._get(url), json=True)
File "/usr/local/lib/python3.7/dist-packages/docker/utils/decorators.py", line 46, in inner
return f(self, *args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/docker/api/client.py", line 237, in _get
return self.get(url, **self._set_request_timeout(kwargs))
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionRefusedError(111, 'Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/docker-compose", line 10, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/dist-packages/compose/cli/main.py", line 67, in main
command()
File "/usr/local/lib/python3.7/dist-packages/compose/cli/main.py", line 123, in perform_command
project = project_from_options('.', options)
File "/usr/local/lib/python3.7/dist-packages/compose/cli/command.py", line 69, in project_from_options
environment_file=environment_file
File "/usr/local/lib/python3.7/dist-packages/compose/cli/command.py", line 132, in get_project
verbose=verbose, version=api_version, context=context, environment=environment
File "/usr/local/lib/python3.7/dist-packages/compose/cli/docker_client.py", line 43, in get_client
environment=environment, tls_version=get_tls_version(environment)
File "/usr/local/lib/python3.7/dist-packages/compose/cli/docker_client.py", line 170, in docker_client
client = APIClient(**kwargs)
File "/usr/local/lib/python3.7/dist-packages/docker/api/client.py", line 197, in __init__
self._version = self._retrieve_server_version()
File "/usr/local/lib/python3.7/dist-packages/docker/api/client.py", line 222, in _retrieve_server_version
'Error while fetching server API version: {0}'.format(e)
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', ConnectionRefusedError(111, 'Connection refused'))
serwer@linux:~$
jureg2
Posty: 13
Rejestracja: pt paź 11, 2019 8:11 pm

czw sty 14, 2021 8:51 pm

Witam
Podczas instalacji docker -compoze daje taki wynik

pi@raspberrypi:~ $ sudo pip install docker-compose
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting docker-compose
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting backports.ssl-match-hostname<4,>=3.5; python_version < "3.5" (from docker-compose)
Using cached https://www.piwheels.org/simple/backpor ... ne-any.whl
Collecting backports.shutil-get-terminal-size==1.0.0; python_version < "3.3" (from docker-compose)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting six<2,>=1.3.0 (from docker-compose)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting docopt<1,>=0.6.1 (from docker-compose)
Using cached https://www.piwheels.org/simple/docopt/ ... ne-any.whl
Collecting dockerpty<1,>=0.4.1 (from docker-compose)
Using cached https://files.pythonhosted.org/packages ... 4.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named setuptools

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-gI_JE4/dockerpty/
Awatar użytkownika
lesny8
Posty: 1540
Rejestracja: pn gru 11, 2017 9:43 pm

czw sty 14, 2021 10:21 pm

Kod: Zaznacz cały

sudo apt-get install python-setuptools
jureg2
Posty: 13
Rejestracja: pt paź 11, 2019 8:11 pm

pt sty 15, 2021 2:29 pm

Dalej problem proszę pomóż :)

pi@raspberrypi:~ $ docker-compose -v
/usr/local/bin/docker-compose: line 1: Not: command not found
Awatar użytkownika
lesny8
Posty: 1540
Rejestracja: pn gru 11, 2017 9:43 pm

pt sty 15, 2021 6:16 pm

A po zainstalowaniu python-setuptools ponowiłeś?

Kod: Zaznacz cały

sudo pip install docker-compose
jureg2
Posty: 13
Rejestracja: pt paź 11, 2019 8:11 pm

pt sty 15, 2021 6:56 pm

Witam
Właśnie tak robię i dostaje to

pi@raspberrypi:~ $ sudo pip install docker-compose
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting docker-compose
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting backports.ssl-match-hostname<4,>=3.5; python_version < "3.5" (from docker-compose)
Using cached https://www.piwheels.org/simple/backpor ... ne-any.whl
Collecting backports.shutil-get-terminal-size==1.0.0; python_version < "3.3" (from docker-compose)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting six<2,>=1.3.0 (from docker-compose)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting docopt<1,>=0.6.1 (from docker-compose)
Using cached https://www.piwheels.org/simple/docopt/ ... ne-any.whl
Collecting dockerpty<1,>=0.4.1 (from docker-compose)
Using cached https://files.pythonhosted.org/packages ... 4.1.tar.gz
Collecting enum34<2,>=1.0.4; python_version < "3.4" (from docker-compose)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting requests<3,>=2.20.0 (from docker-compose)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting distro<2,>=1.5.0 (from docker-compose)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting subprocess32<4,>=3.5.4; python_version < "3.2" (from docker-compose)
Using cached https://files.pythonhosted.org/packages ... 5.4.tar.gz
Collecting cached-property<2,>=1.2.0 (from docker-compose)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting PyYAML<6,>=3.10 (from docker-compose)
Using cached https://files.pythonhosted.org/packages ... 3.1.tar.gz
Collecting websocket-client<1,>=0.32.0 (from docker-compose)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting docker[ssh]<5,>=4.2.2 (from docker-compose)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting ipaddress<2,>=1.0.16; python_version < "3.3" (from docker-compose)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting jsonschema<4,>=2.5.1 (from docker-compose)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting texttable<2,>=0.9.0 (from docker-compose)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting python-dotenv<1,>=0.13.0 (from docker-compose)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting idna<3,>=2.5 (from requests<3,>=2.20.0->docker-compose)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting urllib3<1.27,>=1.21.1 (from requests<3,>=2.20.0->docker-compose)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting certifi>=2017.4.17 (from requests<3,>=2.20.0->docker-compose)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting chardet<5,>=3.0.2 (from requests<3,>=2.20.0->docker-compose)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting paramiko>=2.4.2; extra == "ssh" (from docker[ssh]<5,>=4.2.2->docker-compose)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Requirement already satisfied: setuptools in /usr/lib/python2.7/dist-packages (from jsonschema<4,>=2.5.1->docker-compose) (40.8.0)
Collecting attrs>=17.4.0 (from jsonschema<4,>=2.5.1->docker-compose)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting importlib-metadata; python_version < "3.8" (from jsonschema<4,>=2.5.1->docker-compose)
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting pyrsistent>=0.14.0 (from jsonschema<4,>=2.5.1->docker-compose)
Using cached https://files.pythonhosted.org/packages ... 7.2.tar.gz
pyrsistent requires Python '>=3.5' but the running Python is 2.7.16
pi@raspberrypi:~ $ docker -v && docker-compose -v
Docker version 20.10.2, build 2291f61
/usr/local/bin/docker-compose: line 1: Not: command not found
Awatar użytkownika
lesny8
Posty: 1540
Rejestracja: pn gru 11, 2017 9:43 pm

pt sty 15, 2021 7:35 pm

Kod: Zaznacz cały

sudo apt update
sudo apt install -y python3-pip
sudo pip3 install docker-compose
ODPOWIEDZ

Wróć do „Ogólna dyskusja”