Coder Social home page Coder Social logo

phaistos's Introduction

phaistos

Dependencies

Make sure you have a running MySQL database. If not you could spawn one with docker like :

Create a docker volume :

docker volume create mysql-data

Create a MySQL instance

docker run \
    -e MYSQL_ROOT_USERNAME=root \
    -e MYSQL_ROOT_PASSWORD=root_password \
    -v mysql-data:/var/lib/mysql \
    --name mysql \
    --restart unless-stopped \
    -d \
    mysql:8.0

Once the database instance is up & running, connect as a root user and create a database :

mysql> create database phaistos_db character set utf8;

and finally, create the db user

CREATE USER 'phaistos'@'%' IDENTIFIED WITH mysql_native_password BY 'phaistos';
GRANT ALL PRIVILEGES ON phaistos_db.* TO 'phaistos'@'%';
flush privileges;

Docker Info

Create a Docker network for the app

docker network create phaistos-net

Attach the running mysql container to the application's network (assume the mysql container is called mysql)

docker network connect --alias mysql phaistos-net mysql
docker build . -t dideira/phaistos-web:latest
docker run --rm -it --name phaistos \
    -e DJANGO_SETTINGS_MODULE=phaistos.settings.staging \
    -e DB_NAME=phaistos_db \
    -e DB_USER=phaistos \
    -e DB_PASS=phaistos \
    -e DB_HOST=mysql \
    -e DB_PORT=3306 \
    -e VIRTUAL_HOST=phaistos-dev.dide.ira.net \
    --network phaistos-net \
    dideira/phaistos-web:latest

or for local development

docker run --rm -it --name phaistos \
    -e DJANGO_SETTINGS_MODULE=phaistos.settings.docker-dev \
    -p 8000:80 \
    dideira/phaistos-web:latest

or daemonize it

docker run --name phaistos \
    -e DJANGO_SETTINGS_MODULE=phaistos.settings.staging \
    -e DB_NAME=phaistos_db \
    -e DB_USER=phaistos \
    -e DB_PASS=phaistos \
    -e DB_HOST=mysql \
    -e DB_PORT=3306 \
    -e VIRTUAL_HOST=phaistos-dev.dide.ira.net \
    -d \
    --network phaistos-net \
    --restart unless-stopped \
    dideira/phaistos-web:latest

Nginx Proxy

In case you need a nginx proxy, then you may

docker network create nginx-proxy
docker run -d -p 80:80 --restart unless-stopped \
    --name nginx-proxy \
    -v /var/run/docker.sock:/tmp/docker.sock:ro \
    --net nginx-proxy \
    jwilder/nginx-proxy

Don't forget to add the nginx-proxy container to the phaistos-net network

docker network connect phaistos-net nginx-proxy

phaistos's People

Contributors

slavikos avatar dependabot[bot] avatar gstam avatar

Watchers

 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.