Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
keevitaja committed Oct 23, 2021
1 parent 622edb9 commit 1d27762
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.idea

.env
2 changes: 0 additions & 2 deletions bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )

source $DIR/env

docker-compose -f $DIR/../docker-compose.yml up --build
9 changes: 0 additions & 9 deletions bin/env

This file was deleted.

2 changes: 0 additions & 2 deletions bin/root
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )

source $DIR/env

docker exec -it --user root -w /root ${DOCKER_APP_CONTAINER} bash
2 changes: 0 additions & 2 deletions bin/start
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )

source $DIR/env

docker-compose -f $DIR/../docker-compose.yml up -d
2 changes: 0 additions & 2 deletions bin/stop
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )

source $DIR/env

docker-compose -f $DIR/../docker-compose.yml down
2 changes: 0 additions & 2 deletions bin/user
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )

source $DIR/env

docker exec -it --user ${DOCKER_APP_USERNAME} -w /var/www/html ${DOCKER_APP_CONTAINER} bash
7 changes: 0 additions & 7 deletions config/docker.env

This file was deleted.

4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ services:
web:
container_name: ${DOCKER_APP_CONTAINER}
restart: always
env_file: ./.env
build:
context: ./config
dockerfile: apache.dockerfile
Expand All @@ -22,9 +23,6 @@ services:
- ./..:/var/www/html
- $HOME/.ssh:/home/user/.ssh
- ./home:/home/user
environment:
- APACHE_RUN_USER=#${DOCKER_APP_UID}
- APACHE_RUN_GROUP=#${DOCKER_APP_UID}
mariadb:
container_name: mariadb-10-4-${DOCKER_APP_NAME}
restart: always
Expand Down
9 changes: 9 additions & 0 deletions env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
DOCKER_APP_NAME=app
DOCKER_APP_CONTAINER=apache-8-0-${DOCKER_APP_NAME}
DOCKER_APP_UID=1000
DOCKER_APP_GID=1000
DOCKER_APP_USERNAME=user
DOCKER_APP_HOSTNAME=app.localhost
DOCKER_APP_DOCROOT=public
APACHE_RUN_USER=#${DOCKER_APP_UID}
APACHE_RUN_GROUP=#${DOCKER_APP_UID}
4 changes: 3 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Docker setup for php development (WIP)

Put this repository into your project root and copy config/docker.env to your project root and make changes as needed.
Put this repository into your project root and copy `env.example` to `.env` and make changes as needed.

You should match UID,GIT,USERNAME to your host machine.

```
└── project_root
Expand Down

0 comments on commit 1d27762

Please sign in to comment.