No Description

abdofarag e7f1eb1a54 Update 'docker-compose.yml' 5 years ago
docker-back 1ee3734f2c add .env file 5 years ago
docker-front 7f0390c7e2 Update code 5 years ago
docker-memcached d6e63af90c add memcached 5 years ago
.env-examble 1ee3734f2c add .env file 5 years ago
.gitignore 1ee3734f2c add .env file 5 years ago
LICENSE f4e522884e init commit 6 years ago
README.md 5b0958b81c Update 'README.md' 5 years ago
clean.sh d6e63af90c add memcached 5 years ago
docker-compose.yml e7f1eb1a54 Update 'docker-compose.yml' 5 years ago
setup.sh bffc721585 Update 'setup.sh' 5 years ago

README.md

Barcode-Docker

  • Backend
  • Frontend
  • MYsql
  • Celery (Worker - Beat - Flower)
  • rabbitmq
  • phpmyadmin
  • Memcahced

Fully automated installation "Support Ubuntu server 16.04.4."

RUN cd /opt/ && git clone https://gogs.earthsquad.global/abdofarag/barcode-frontend-backend-docker barcode-docker RUN cd barcode-docker

modify parameters from .env-examble file

Run cp .env-examble .env

Then modify .env file with your Gogs info.
  • GIT_USER=gogs_username
  • GIT_PASS=gogs_password
  • IP_ADDR=server_ipaddress

RUN ./setup.sh

It will take a while to build and deploy Docker images and build and deploy codes.

After finish deployment chack that all containers are up and running.

RUN docker ps -a

Now you can direct navigate your browser.

Backend http://$IP_ADDR:8000/api/admin/
Frontend http://$IP_ADDR:8080/
Mysql-admin http://$IP_ADDR:5000/
Celery-Flower http://$IP_ADDR:5555/

Default database name backend_dev

Backend ---> access admin Defualt_Pass from setup.sh
Frontend ---> access admin Defualt_Pass from setup.sh
Mysql-admin:5000 ---> access backend Defualt_Pass from setup.sh

Updates / get latest changes

When there are changes to the frontend or backend and you want to get the latest changes to your DEV-System

  • Commit your previous changes usng GIT PUSH to whatever repository you made changes
  • RUN cd /opt/barcode-docker
  • RUN ./setup.sh

Reset Docker Containers

If you want to reset all containers, etc.

  • Commit your previous changes using GIT PUSH to whatever repository you made changes
  • RUN cd /opt/barcode-docker
  • RUN ./clean.sh Then follow the steps in Chapter "Fully automated installation "Support Ubuntu server 16.04.4."

Manual Instlation On Ubuntu/Debian

Install Docker On your OS.

Example: install docker on Ubuntu server 16.04.4.

Install Docker from Ubuntu’s repositories:

  • RUN apt-get update
  • RUN apt-get install -y docker.io

or install Docker CE 18.03 from Docker’s repositories for Ubuntu or Debian:

  • RUN apt-get update
  • RUN apt-get install -y apt-transport-https ca-certificates curl software-properties-common
  • RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
  • RUN add-apt-repository "deb https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") $(lsb_release -cs) stable"
  • RUN apt-get update && apt-get install -y docker-ce=$(apt-cache madison docker-ce | grep 18.03 | head -1 | awk '{print $3}')

Install Docker-Compose On your OS.

Example: install docker on Ubuntu server 16.04.4.

  • RUN curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-uname -s-uname -m-o /usr/local/bin/docker-compose
  • RUN chmod +x /usr/local/bin/docker-compose

Clone Barcode-Docker

  • RUN git clone https://gogs.earthsquad.global/abdofarag/barcode-frontend-backend-docker barcode-docker

Start Barcode APP

  • RUN cd barcode-docker
  • RUN docker-compose up -d --build

To Run API-Test script

You have to import this sql file to your database over phpmyadmin sql console.

  • Download sql file RUN wget https://gogs.earthsquad.global/athos/api_test/raw/master/scanapp_master_data.sql
  • Navigate your Browser to phpmyadmin sql console http://$IP_ADDR:5000/db_sql.php?db=backend_dev
  • put scanapp_master_data.sql content in sql console then Click GO.

Then you can run API-Test script easly.

Memcached configuration

Add code down Below to /opt/back/barcode/settings.py or /opt/back/barcode/local.py.

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
        'LOCATION': 'memcached:11211',
    }
}

TO monitor Memcached
  • RUN memcache-top --instance=127.0.0.1