Skip to content

Запуск с использованием docker-compose

В этом разделе показано, как установить услугу Nutrix с помощью docker-compose.

TIP

На Windows убедитесь, что WSL2 установлен перед началом.

INFO

Убедитесь, что установлены git, docker и docker-compose

1. Клонируйте репо pos и запустите docker compose

sh
git clone https://github.com/nutrixpos/pos.git
cd pos
docker-compose up --build -d

2. Настройка автозапуска

INFO

For Windows users !

Enable systemd in wsl config

sh
vim /etc/wsl.conf
[boot]
systemd=true

You will then need to close the Linux distribution. You can use the command wsl.exe --shutdown in PowerShell to restart all WSL instances.

Once your Linux distribution restarts, systemd will be running. You can confirm using the command: systemctl list-unit-files --type=service, which will show the status of any services associated with your Linux distribution.

for more info refer to WSL Systemd

Create systemd unit files

sh
sudo nano /etc/systemd/system/nutrix.service
[Unit]
Description=My Docker Compose Service
Requires=docker.service
After=docker.service

[Service]
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/path/to/your/pos_repo
ExecStartPre=/usr/bin/docker-compose down
ExecStart=/usr/bin/docker-compose up -d
ExecStop=/usr/bin/docker-compose down
Restart=no

[Install]
WantedBy=multi-user.target

TIP

Make sure you change /path/to/your/pos_repo in the above file to the pos repo path on your machine

Enable and start the service

sh
sudo systemctl enable nutrix.service
sudo systemctl start nutrix.service

3. Откройте консоль nutrix

Откройте консоль nutrix по адресу http://localhost:3000