Skip to content

Commit a4eb039

Browse files
authored
Ease development with Docker
1 parent 7ce54cd commit a4eb039

File tree

4 files changed

+35
-3
lines changed

4 files changed

+35
-3
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM php:8.1-cli-alpine
22

3-
WORKDIR /opt/mongodb-php-gui
4-
COPY . /opt/mongodb-php-gui
3+
WORKDIR /app
4+
COPY . /app
55

66
RUN echo "; PHP settings added by MongoDB PHP GUI (MPG)" > /usr/local/etc/php/conf.d/mpg-docker-php.ini \
77
&& echo "upload_max_filesize = 25M" >> /usr/local/etc/php/conf.d/mpg-docker-php.ini \

compose.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
services:
2+
app:
3+
build: .
4+
develop:
5+
watch:
6+
- action: sync
7+
path: ./assets
8+
target: /app/assets
9+
- action: sync
10+
path: ./extras
11+
target: /app/extras
12+
ignore:
13+
- dataset/
14+
- action: sync
15+
path: ./source
16+
target: /app/source
17+
- action: sync
18+
path: ./views
19+
target: /app/views
20+
- action: rebuild
21+
path: .dockerignore
22+
- action: rebuild
23+
path: composer.json
24+
- action: rebuild
25+
path: Dockerfile
26+
ports:
27+
- 5000:5000
28+
extra_hosts:
29+
- "localhost:172.17.0.1"

copy-vendor.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
container_id=$(docker ps -qf "name=mongodb-php-gui")
3+
docker cp ${container_id}:/app/vendor ./vendor

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
/**
1212
* Absolute path, without trailing slash.
13-
* Example: /opt/mongodb-php-gui
13+
* Example: /app
1414
*/
1515
const ABS_PATH = __DIR__;
1616

0 commit comments

Comments
 (0)