Which directory do I put the files from my website to be accessed through the web server running in a Docker container?

Asked

Viewed 48 times

0

I created a Docker container using Docker-Compose
The archive Docker-Compose.yml is in the directory /home//Dockerfolder. The file is configured as follows:

####
# ATENTION:
# Replace all occurences of sandbox with your project's name
####

# v2 syntax
version: '2'

# Named volumes
volumes:

# MySQL Data
sandbox-mysql-data:
 driver: local

services:
# MySQL (5.7)
mysql:
 image: mysql:5.7
 container_name: sandbox-mysql
 volumes:
  - sandbox-mysql-data:/var/lib/mysql
 ports:
  - "3306:3306"
 environment:
  - MYSQL_ROOT_PASSWORD=sandbox
  - MYSQL_DATABASE=sandbox
  - MYSQL_USER=sandbox
  - MYSQL_PASSWORD=sandbox

# PHP (with Nginx)
# you can change from nginx to apache, just change session 'image'
app:
 image: ambientum/php:7.2-nginx
 container_name: sandbox-app
volumes:
  - .:/var/www/app
 ports:
  - "80:8080"
 links:
  - mysql

# Laravel Queues
queue:
 image: ambientum/php:7.2
 container_name: sandbox-queue
 command: php artisan queue:listen
 volumes:
  - .:/var/www/app
 links:
  - mysql

I created the index.php file in the same directory to test the server, but no information was returned. Is the file in the right place? How I can view it in the browser?

  • /var/www/app?

  • yes, I read that this container folder is mapped to a folder on the host.

1 answer

0


The answer in the present case is /home/Dockerfolder.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.