Sample microservices application demo

Overview

Development mode

docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d

or

export COMPOSE_FILE='docker-compose.yml:docker-compose.dev.yml'
docker-compose up -d

It is possible that the api service started before db was ready. If this is the case, it won't be able to connect to it. Fix this with:

docker-compose restart api

The first time you start this, you have to run the database migrations:

docker-compose exec api ./manage.py migrate

Production mode

You will have to start by provisioning a remote docker host. Using Digital Ocean as an example cloud provider.

First you need to generate an API token in digital ocean's UI. Then:

export DOTOKEN='...'

# Provision a remote docker host
docker-machine create \
    --driver digitalocean \
    --digitalocean-access-token $DOTOKEN \
    --digitalocean-image centos-8-x64 \
    codecamp

# Configure local docker clients to talk to remote docker host
eval $(docker-machine env codecamp)

# Make sure COMPOSE_FILE is empty
unset COMPOSE_FILE

docker-compose up -d

You can now view the application by visiting the remote host's IP address. Get it in Digital Ocean's UI or with:

docker-machine ip codecamp
You might also like...
A demo of a data science project using Kedro

iris Overview This is your new Kedro project, which was generated using Kedro 0.17.4. Take a look at the Kedro documentation to get started. Rules and

Demo of a WAM Prolog implementation in Python

Prol: WAM demo This is a simplified Warren Abstract Machine (WAM) implementation for Prolog, that showcases the main instructions, compiling, register

Demo Python project using Conda and Poetry

Conda Poetry This is a demonstration of how Conda and Poetry can be used in a Python project for dev dependency management and production deployment.

A demo Piccolo app - a movie database!

PyMDb Welcome to the Python Movie Database! Built using Piccolo, Piccolo Admin, and FastAPI. Created for a presentation given at PyData Global 2021. R

Serverless demo showing users how they can capture (and obfuscate) their Lambda payloads in Datadog APM
Serverless demo showing users how they can capture (and obfuscate) their Lambda payloads in Datadog APM

Serverless-capture-lambda-payload-demo Serverless demo showing users how they can capture (and obfuscate) their Lambda payloads in Datadog APM This wi

Demo content - Automate your automation!

Automate-AAP2 Demo Content - Automate your automation! A fully automated Ansible Automation Platform. Context Installing and configuring Ansible Autom

Repo to demo translating colab/jupyter notebook to streamlit webapp

Repo to demo translating colab/jupyter notebook to streamlit webapp

Demo of using DataLoader to prevent out of memory

Demo of using DataLoader to prevent out of memory

Demo of connecting Rasa with Zalo

Demo of connecting Rasa with Zalo

Owner
Konstantinos Bairaktaris
Konstantinos Bairaktaris
Minos-python - A framework which helps you create reactive microservices in Python

minos-python Summary [TODO] Packages minos-microservice-aggregate minos-microser

Minos Framework 380 Jan 4, 2023
Korg Volca Sample uploader for linux.

GnuVolca Korg Volca Sample uploader for linux. GnuVolca Usage Installation Via virtualenv Usage Store all the samples you want to upload on an empty d

Gonzalo Rafuls 12 Oct 11, 2022
This is a far more in-depth and advanced version of "Write user interface to a file API Sample"

Fusion360-Write-UserInterface This is a far more in-depth and advanced version of "Write user interface to a file API Sample" from https://help.autode

null 4 Mar 18, 2022
Sample python script for monitoring Rocketchat database and get statistics of users.

rocketchat-DB-monitoring Sample python script for monitoring Rocketchat database and get statistics of users. 1. Update python: yum check-update && yu

Mojtaba Taleghani 1 Apr 12, 2022
This is sample project needed for security course to connect web service to database

secufaku This is sample project needed for security course to "connect web service to database". Why it suits alignment purpose It connects to postgre

Mark Nicholson 6 May 15, 2022
Algo Phantoms 44 Nov 15, 2022
ArinjoyTheDev 1 Jul 17, 2022
Runnable Python demo of ArtLine

artline-demo How to run? pip3 install -r requirements.txt python3 app.py How to use? Run the Flask app Open localhost:5000 in browser Select an image(

Jiang Wenjian 134 Jul 29, 2022
Tiny demo site for exploring SameSite=Lax

samesite-lax-demo Background on my blog: Exploring the SameSite cookie attribute for preventing CSRF This repo holds some tools for exploring the impl

Simon Willison 6 Nov 10, 2021
An extended version of the hotkeys demo code using action classes

An extended version of the hotkeys application using action classes. In adafruit's Hotkeys code, a macro is using a series of integers, assumed to be

Neradoc 5 May 1, 2022