mzazon / php-apache-mysql-containerized Goto Github PK
View Code? Open in Web Editor NEWA brief demo of containerizing php apache and mysql with Docker using some best practices.
A brief demo of containerizing php apache and mysql with Docker using some best practices.
How should i circumvent the problem where the data from the volume in the PROJECT_ROOT directory (from the host) is owned by root? It is not desirable to copy the files into the container. Is there another way to chown to files to www-data?
I forked this package, and I'm studying docker. So, I want to use xdebug installed via docker on phpstorm. But, I don't know if I have to create an image in this package, or I have to create another container to do it.
What I have to do?
This was working for me yesterday but then I've upgraded to the latest version of Docker and now it seemingly fails with the message below once I run docker-compose up -d
Docker CE : 18.06.1-ce-win73 (19507) (Running Windows 10 Pro)
Channel : stable
Compose : 1.22.0
Machine : 0.15.0
Notary : 0.6.1
Credential Helpers : 0.6.0
Kubernetes : 1.10.3
php-apache-mysql-containerized_mysql_1 is up-to-date
php-apache-mysql-containerized_php_1 is up-to-date
Starting php-apache-mysql-containerized_apache_1 ... error
ERROR: for php-apache-mysql-containerized_apache_1 Cannot start service apache: driver failed programming external connectivity on endpoint php-apache-mysql-containerized_apache_1 (2e04f997df1445f9305ec47b8b2dc10e9fcf4387a342837a7193023d018df862): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:8080:tcp:172.19.0.2:80: input/output error
ERROR: for apache Cannot start service apache: driver failed programming external connectivity on endpoint php-apache-mysql-containerized_apache_1 (2e04f997df1445f9305ec47b8b2dc10e9fcf4387a342837a7193023d018df862): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:8080:tcp:172.19.0.2:80: input/output error
ERROR: Encountered errors while bringing up the project.`
$docker compose up got hang at mysql clean up in mac terminal
mysql | 2018-09-17T16:03:23.143973Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 14539ms. The settings might not be optimal. (flushed=0 and evicted=0, during the time.)
After executing docker-compose up -d
and opening the webpage in the browser it won't connect to MySQL. If I restart the MySQL container it works. Any ideas?
I have tried to create some folders in public_html and made some changes to apache config, but it haven't worked
please add mod_rewrite in dockerfile.
For some reason this whole Docker thing isn't setting in for me, their docs seem to be all over and it's hard to know what docker does vs the individual packages. I'm simply attempting to setup a server locally to develop on (not be a docker expert).
So far your tutorial and this repo has really gotten me past the annoying obstacles of just setting up an environment so thank you.
But now I need to glance and explore the database itself, so I turned to "phpmyadmin" to see if that would work (I'd be game to try a desktop application too, but not sure if the database is accessible due to the "backend" network).
This is what I've done so far to the docker-compose.yml
file:
phpmyadmin:
image: phpmyadmin:fpm-alpine
restart: always
depends_on:
- mysql
ports:
- 8080:80
networks:
- frontend
- backend
environment:
MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}"
PMA_ARBITRARY: 1
PMA_HOST: mysql
PMA_PORT: 3306
UPLOAD_LIMIT: 10M
The attempt at least in my head is that this uses the PMA_HOST
to connect to the //mysql
domain and the 3306 port. This configuration errors because the port 8080 is already in use (apache?). I'm not sure how I would alter the port that phpmyadmin uses to then alter: 8081:3001
(3001 being the external port that I'd hit on my machine localhost:3001
.
Is there something I'm missing? Do you have any suggested docs I should look at?
Hi, all!
I'm trying to run docker-compose up on Windows 10 1803, with latest docker installed (18.09.1) and getting following error:
ERROR: for apache Cannot start service apache: container e06e91183bdf4dfe035995e083975827d7228864d15ca7b1a2ecd2bb8edcbdea encountered an error during CreateProcess: failure in a Windows system call: Unspecified error (0x80004005)
[Event Detail: failed to configure network adapter f995e2c2-b0bf-459f-8557-336bd1a8771f: netlink.RouteAdd(netlink.Route{LinkIndex:5, ILinkIndex:0, Scope:0x0, Dst:(*net.IPNet)(nil), Src:net.IP(nil), Gw:net.IP{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xac, 0x1e, 0xb0, 0x1}, MultiPath:[]*netlink.NexthopInfo(nil), Protocol:0, Priority:1, Table:0, Type:0, Tos:0, Flags:0, MPLSDst:(*int)(nil), NewDst:netlink.Destination(nil), Encap:netlink.Encap(nil)}) failed: file exists: exit status 255
Any idea what could be the problem? I tried restart of docker, restart of OS, tried clearing and starting new containers several times with no prevail...
In addition: there are 3 errors in System Event log with following (and similar) messages:
Failed to connect NIC 1C291E5B-03B7-4F47-98D7-47F4B8E08555--0DC89A26-A4DD-49A6-ABFE-2A5F471A6BAF (Friendly Name: ) to port (Friendly Name: ) on switch (Friendly Name: ), status = Object Name not found.
Building php
Step 1/4 : ARG PHP_VERSION=""
Step 2/4 : FROM php:${PHP_VERSION:+${PHP_VERSION}-}fpm-alpine
---> 6feac8f2ef42
Step 3/4 : RUN apk update; apk upgrade;
---> Running in 7bc8afc11c4a
ERROR: Unable to read database state: No such file or directory
ERROR: Failed to open apk database: No such file or directory
ERROR: Unable to read database state: No such file or directory
ERROR: Failed to open apk database: No such file or directory
ERROR: Service 'php' failed to build: The command '/bin/sh -c apk update; apk upgrade;' returned a non-zero code: 99
I am unable to enter into php image
$ docker exec -it 25edb9895ba2 /bin/bash
OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "exec: "/bin/bash": stat /bin/bash: no such file or directory": unknown
$docker-compose up got hang at mysql installation in google cloud ubuntu terminal
mysql | Version: '5.7.23' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.