New Hosting Script
With Docker Compose
nano docker-compose.yml
version: '3'
services:
doltdb:
image: dolthub/dolt-sql-server:latest
command:
-l debug
volumes:
- doltdb-data:/var/lib/dolt
- doltdb-root:/.dolt
- doltdb-configs:/etc/dolt
- ./init-dolt.sh:/docker-entrypoint-initdb.d/init-dolt.sh
ports:
- "3306:3306"
networks:
- default
restart: always # Add this line
webserver:
build: .
command: ["/bin/bash", "-c", "source /app/venv/bin/activate && flask run -h 0.0.0.0"]
ports:
- "5000:5000"
networks:
- default
restart: always # Add this line
networks:
default:
external:
name: my-network
volumes:
doltdb-data: {}
doltdb-root: {}
doltdb-configs: {}
nano Dockerfile
# Use a base image with Ubuntu
FROM ubuntu:latest
# Set non-interactive mode
ENV DEBIAN_FRONTEND=noninteractive
# Update package sources and install necessary packages
RUN apt-get update && apt-get install -y \
git \
python3 \
python3-venv \
curl \
lsof \
wget \
npm \
supervisor \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y supervisor \
&& rm -rf /var/lib/apt/lists/*
# Clone repositories
RUN git clone https://gitlab.com/DevanshuBrahmbhatt/qubic-data-storage.git /app/qubic-data-storage
# Install required Python packages
RUN python3 -m venv /app/venv \
&& /app/venv/bin/pip3 install -r /app/qubic-data-storage/requirements.txt
# Set working directory for frontend
WORKDIR /app/qubic-data-storage/qubic-data-storage-frontend
# Install Node.js using NVM
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash \
&& . ~/.nvm/nvm.sh \
&& nvm install 14 \
&& nvm use 14 \
&& npm install -g yarn
RUN ls -la
ENV PATH="/usr/bin/versions/node/v14.21.3/bin:${PATH}"
# Build and run Vue.js frontend
RUN yarn install
RUN yarn build
# Expose the necessary ports
EXPOSE 5000
# Set working directory to qubic-data-storage
WORKDIR /app/qubic-data-storage
# Copy supervisor configuration
#COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Start processes
#CMD ["/usr/bin/supervisord"]
CMD ["/bin/bash", "-c", "source /app/venv/bin/activate && flask run -h 0.0.0.0"]
nano init-dolt.sh
dolt config --global --add user.email doltServer@company.com
dolt config --global --add user.name "Dolt Server Account"
dolt sql -q "CREATE DATABASE calibration"
sudo apt-get update
sudo apt-get install docker.io
sudo apt-get install docker-compose
sudo docker-compose build
sudo docker network create my-network
sudo docker-compose up -d
sudo docker run --network my-network -it mysql:latest mysql -u root --host doltdb --port 3306 -p #####
Jupyter Notebook
git clone https://gitlab.com/DevanshuBrahmbhatt/qubic-jupyter.git
source notebook_env/bin/activate
pip install .
pip install notebook
# export PATH=$PATH:/home/usr/.local/bin
jupyter notebook
Last updated