Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of the Box www location #3

Closed
Hi-ImKyle opened this issue Mar 20, 2019 · 1 comment
Closed

Out of the Box www location #3

Hi-ImKyle opened this issue Mar 20, 2019 · 1 comment

Comments

@Hi-ImKyle
Copy link

Ok so I'm still getting the hang of how docker works and what not since I've moved most of my programs without issue over to it. Just I can't for the life of me find where the www is for this container?

Can you help me please?

@romeOz
Copy link
Owner

romeOz commented Mar 24, 2019

If source code is on a host, then:

docker run --name app -d -p 8080:80 \
   -v /host/to/path_source_code/:/var/www/app/ \
   romeoz/docker-apache-php

tip from README

But right way is source code and environment (in this case, Apache and php) must be inside docker-image. Development, unit-testing and deploy of code is made within environment, i.e. such a image moves throughout the chain step by step.

For this create your image on based current.

Сontents Dockerfile:

FROM romeoz/docker-apache-php:7.3

COPY /host/to/path_source_code/ /var/www/app/

WORKDIR /var/www/app/

EXPOSE 80 443

CMD ["/sbin/entrypoint.sh"]

Next step,

docker build -t php-7.3 .
docker run --name app -d -p 8080:80 php-7.3

Docks on command COPY

So, each project should have its own image.

Maicost added a commit to Maicost/docker-apache-php that referenced this issue Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants