forked from gae-init/gae-init
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-dev-env.sh
More file actions
executable file
·59 lines (47 loc) · 1.51 KB
/
Copy pathstart-dev-env.sh
File metadata and controls
executable file
·59 lines (47 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
set -e # exit on error
BASEDIR=$(dirname "$0")
cd "${BASEDIR}" # connect to root
docker build -t gae-init docker/
if [ "$(uname -s)" == "Linux" ]; then
USER_NAME=${SUDO_USER:=$USER}
USER_ID=$(id -u "${USER_NAME}")
GROUP_ID=$(id -g "${USER_NAME}")
else # boot2docker uid and gid
USER_NAME=$USER
USER_ID=1000
GROUP_ID=50
fi
#
# sudo setup from here :
# http://stackoverflow.com/questions/25845538/using-sudo-inside-a-docker-container
#
docker build -t "gae-init-${USER_NAME}" - <<UserSpecificDocker
FROM gae-init
RUN groupadd --non-unique -g ${GROUP_ID} ${USER_NAME}
RUN useradd -g ${GROUP_ID} -u ${USER_ID} -k /root -m ${USER_NAME}
RUN echo "${USER_NAME}:password" | chpasswd && adduser ${USER_NAME} sudo
ENV HOME /home/${USER_NAME}
UserSpecificDocker
# sudo pip install -r requirements.txt
# npm install
# bower install
# sh run.sh &
# gulp
# Setup remote notifications
# https://github.com/fgrehm/notify-send-http
#
# Client first...
# Grab Docker bridge IP
DOCKER_BRIDGE_IP=$(/sbin/ifconfig docker0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
# Run docker
docker run --rm=true -t -i \
-v "${PWD}:/home/${USER_NAME}/gae-init" \
-w "/home/${USER_NAME}/gae-init" \
-u "${USER_NAME}" \
-p 35729:35729 \
-p 8080:8080 \
-p 8081:8081 \
"gae-init-${USER_NAME}" \
gulp -o 0.0.0.0 -a"--admin_host=0.0.0.0 --log_level=debug --dev_appserver_log_level=debug --skip_sdk_update_check=1"
# @TODO: Set all GAE paths to something local so data,blobs,images etc is maintained across runs