File tree Expand file tree Collapse file tree 4 files changed +40
-4
lines changed
Expand file tree Collapse file tree 4 files changed +40
-4
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ LOCAL_PHP_XDEBUG_MODE=develop,debug
3636# Whether or not to enable Memcached.
3737LOCAL_PHP_MEMCACHED = false
3838
39+ # Whether or not to enable FTP.
40+ LOCAL_FTP = false
41+
3942# #
4043# The database software to use.
4144#
Original file line number Diff line number Diff line change 1+ FROM wordpressdevelop/php:latest
2+
3+ # Install the FTP extension
4+ RUN docker-php-ext-install ftp
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ services:
3232 # The PHP container.
3333 # #
3434 php :
35- image : wordpressdevelop/php:${LOCAL_PHP-latest}
35+ build :
36+ context : .
37+ dockerfile : Dockerfile
3638
3739 networks :
3840 - wpdevnet
@@ -138,6 +140,27 @@ services:
138140 php :
139141 condition : service_started
140142
143+ # #
144+ # The FTP container.
145+ # #
146+ ftp :
147+ image : ' garethflowers/ftp-server:latest'
148+
149+ networks :
150+ - wpdevnet
151+
152+ ports :
153+ - ' 20-21:20-21/tcp'
154+ - ' 40000-40009:40000-40009/tcp'
155+
156+ volumes :
157+ - ./src/:/home/admin/
158+
159+ environment :
160+ FTP_USER : admin
161+ FTP_PASS : password
162+ PUBLIC_IP : ${SERVICE_NAME:-ftp}
163+
141164volumes :
142165 # So that sites aren't wiped every time containers are restarted, MySQL uses a persistent volume.
143166 mysql : {}
Original file line number Diff line number Diff line change 2828}
2929
3030// Start the local-env containers.
31- const containers = ( process . env . LOCAL_PHP_MEMCACHED === 'true' )
32- ? 'wordpress-develop memcached'
33- : 'wordpress-develop' ;
31+ let containers = 'wordpress-develop' ;
32+
33+ if ( process . env . LOCAL_PHP_MEMCACHED === 'true' ) {
34+ containers += ' memcached' ;
35+ }
36+
37+ if ( process . env . LOCAL_FTP === 'true' ) {
38+ containers += 'ftp' ;
39+ }
3440execSync ( `docker compose ${ composeFiles } up --quiet-pull -d ${ containers } ` , { stdio : 'inherit' } ) ;
3541
3642// If Docker Toolbox is being used, we need to manually forward LOCAL_PORT to the Docker VM.
You can’t perform that action at this time.
0 commit comments