Git Product home page Git Product logo

froggy-service's Introduction

Froggy's service

Project setup using cookiecutter-django-vue

Development

Create your own .env file at root, e.g. using .env.example:

$ sudo cp .env.example .env

Use --build to rebuild image, -d to run containers in the background :

$ docker-compose up --build

Use -v to clean volume while stop containers:

$ docker-compose down -v

Run production:

$ docker-compose -f docker-compose-prod.yml up --build
$ docker-compose -f docker-compose-prod.yml down -v

Base on your operating system, missing bindings might happen:

$ docker-compose up --build
...
Node Sass could not find a binding for your current environment: Linux/musl 64-bit with Node.js 10.x

Try mounting container's node_module to volume with a different name, e.g. changing docker-compose.yml:

volumes:
  node_modules_volume:

frontend:
  image: node:10-alpine
  command: npm run serve
  volumes:
    - ./.env:/app/.env:ro
    - ./frontend:/app
    - node_modules_volume:/usr/src/app/node_modules
  working_dir: /app
  restart: on-failure

See: Docker ALPINE Linux throws node-sass missing binding error

Deploy

Run the app in Kubernetes The folder k8s-specifications contains the yaml specifications of the App's services.

First create the app namespace

$ kubectl create namespace app

Create secrets

$ kubectl create secret generic environs --from-env-file .env.example --namespace app

Run the following command to create the deployments and services objects:

$ kubectl create -f k8s-specifications/
ingress.extensions/admin-ingress created
deployment.extensions/api created
service/api-service created
ingress.extensions/fs-ingress created
backendconfig.cloud.google.com/froggy-service-backendconfig created
deployment.extensions/postgres created
service/postgres created
deployment.extensions/nginx created
service/nginx-service created

Clean up

$ kubectl delete --all ing --namespace=app
$ kubectl delete --all backendconfig --namespace=app
$ kubectl delete --all services --namespace=app
$ kubectl delete --all deployments --namespace=app
$ kubectl delete --all secrets --namespace=app

Architecture

Architecture diagram

Licence

  • Copyright (C) 2019 - 2019 台北市議員邱威傑辦公室. All rights reserved.
  • Distributed under the GNU AGPL v3.0

froggy-service's People

Contributors

travishen avatar ankycheng avatar matsuilin101 avatar mattlin4567 avatar weichiachang avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.