Coder Social home page Coder Social logo

blog_app's Introduction

1. Start the container

Download and launch the container. Especially the download process may take a while if your internet connection is slower.

❯ docker-compose up -d

Run docker ps to find out the name of your php container. It should look like this for docker >= 4.1 s2-coding-challenge-php-1 (docker < 4.1 s2-coding-challenge_php_1) (name of the folder + php + number of instance) then you can open a bash into your container using:

❯ docker ps
CONTAINER ID   IMAGE                       COMMAND                  CREATED              STATUS                        PORTS                                                        NAMES
f47293b013a9   s2-coding-challenge_nginx   "/docker-entrypoint.…"   About a minute ago   Up About a minute             0.0.0.0:80->80/tcp, :::80->80/tcp                            s2-coding-challenge-nginx-1
5f308739b6eb   s2-coding-challenge_php     "docker-php-entrypoi…"   About a minute ago   Up About a minute             9000/tcp                                                     s2-coding-challenge-php-1
df0c8329609f   mysql/mysql-server:latest   "/entrypoint.sh mysq…"   About a minute ago   Up About a minute (healthy)   0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060-33061/tcp   s2-coding-challenge-mysql-1

then you can enter the php container (/bin/ash is not a type. It is alpines shell)

❯ docker exec -it s2-coding-challenge-php-1 /bin/ash

In the container: Initialization

❯ composer install
❯ bin/console doctrine:schema:update --force
❯ bin/console doctrine:fixtures:load -n
❯ yarn install
❯ yarn encore dev

Frontend build

Whenever you have made changes in the frontend and thus also after your initialization, you need to run the build process for this

❯ yarn encore dev

Congratulations !

You have successfully set up your coding challange DEV environment. You can now access the application in your browser

http://localhost

The application code can be found in the src folder.

You can access the DB by typing following into your local shell

❯ docker exec -it s2-coding-challenge-mysql-1 /bin/bash
❯ mysql -u user -ppassword

Troubleshooting

docker container are not starting

please shutdown all other projects in docker to avoid using port 80 and 3306. You can run docker ps to identify other running containers. Easiest way is to stop then via UI

Already used port 3306 for mysql

when you can't temporary stop the container, or you have a mysql running directly on your machine, please change the port in the following files

  • In file:./docker-compose.yml
    • Uncomment the lines 14, 17 and 18
    • Change the port 3306 to 3307 in lines 16 and 26
  • In file: ./.env
    • Change the port 3306 to 3307 in line 34 (DATABASE_URL)
  • Run docker-compose up -d to update the container settings

blog_app's People

Watchers

Rene Escobar 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.