DEV Community

Discussion on: Docker for Complete Beginners!

Collapse
 
patricnox profile image
PatricNox

I find it to be a terrible idea to have the neccesarity to copy your src folder. You can achieve this, with also bringing the possibility of not having to be inside the container to edit project files, through creating volumes inside a service.

Like so

services:
  app:
    build:
      context: docker
      dockerfile: app/app.dockerfile
    working_dir: /var/www/html
    volumes:
      - ./laravel:/var/www/html:cached
      - ~/.composer/cache:/var/www/.composer/cache/:delegated
    ports:
      - 80:80
Collapse
 
kensixx profile image
Ken Flake

Thanks so much for this info.. I am completely new to Docker, even not touching the volumes part of Docker.

So this is docker-compose, right? Thanks!

What if you're currently restricted to only using Dockerfile? Can you achieve this as the same?