Coder Social home page Coder Social logo

doc's Introduction

Smeetz Docker

This [Docker Compose] powered development environment includes:

  • PHP 7.2 FPM container with Smeetz backend app, CLI tools, and Xdebug
  • Nginx web server, serving smeetz api
  • MySQL database
  • Composer

Installation

Docker Platform can be installed on Windows, Mac, or Linux from their website.
Install Docker.
Install Docker Compose.
Once installed it will run as a background process, and the versions can be checked at the command line:

$ docker -v
$ docker-compose -v

Cloning the backend repo

# Clone this repository for set up docker env
$ git clone https://<username>@bitbucket.org/Smeetz/smeetz-backend.git,

where <username> ur nickname on bitbucket.

Configuring the environment

The .env.dist file found in the root folder should be copied to .env, which is ignored by Git.
Don't forget to change config files of smeetz-backend app (.env file) with new database path if you're going to migrate database from host machine.

# Copy default environment settings
$ cp .env.dist .env

Running the environment

Running docker containers

# Run the environment, ctrl+c to shutdown
$ docker-compose up

# Or run in detached mode with -d, and shutdown after
$  docker-compose  up -d
$ docker-compose down

# To rebuild containers after changes to Docker configuration
$  docker-compose  up --build

# Interact with container
$ docker exec -it -u $(id -u):$(id -g) CONTAINER_NAME bash

If there are no changes to Docker configuration then running docker-composer up --build with the build flag takes very little extra time.

Running Smeetz backend.

#Docker docker containers name/ids
$ docker ps
# Interact with container with current user (working only on Unix OS) or
$ docker exec -it -u $(id -u):$(id -g) CONTAINER_NAME bash
# Interact with container
$ docker exec -it CONTAINER_NAME bash
# Run composer
$ composer install
# Create db
$ php bin/console doctrine:database:create
# Compute difference from old database to new database
$ php bin/console doctrine:schema:update --dump-sql
# Force the changes on the database
$ php bin/console doctrine:schema:update --force
# Load data into the database
$ php app/console doctrine:fixture:load

Also, please add this domain to ur local host file

api.smeetz.local

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.