tdmalone / slackemon

Inspired by Pokémon Go, now you can catch and battle Pokémon with your teammates on Slack!
GNU General Public License v3.0
10 stars 3 forks source link

Update Dockerfile to work with Composer #4

Closed Naramsim closed 7 years ago

Naramsim commented 7 years ago

Hi, you can build the image as usual with

docker build -t slackemon .

and start a server with

docker run -p 80:80 -v ${PWD}:/var/www/html -it --rm --env-file ./.env --name slackemonInstance slackemon

The -v switch allows you to mount a local volume to the Docker container, so one can modify local files and those will sync in the Docker container, so development becomes quicker.

I think we should create a wrapper around Dotenv. In a way that first env vars should be fetched by memory using PHP native getenv, if not present using Dotenv.

juz501 commented 7 years ago

would prefer

$dotenv = new Dotenv\Dotenv();
if(getenv('APP_ENV') === 'development') {
    $dotenv->load(__DIR__);
}

Are we also missing phpdotenv from composer.json? -- I see this is in #5 so maybe a merge thing

ED: See this comment on pull request 5 for more background