File tree Expand file tree Collapse file tree 7 files changed +90
-0
lines changed
Expand file tree Collapse file tree 7 files changed +90
-0
lines changed Original file line number Diff line number Diff line change 1+ FROM ubuntu:16.04
2+
3+ RUN mkdir -p /_build/
4+ WORKDIR /_build/
5+ ADD . /_build/
6+
7+ RUN apt-get update
8+
9+ RUN apt-get install -y \
10+ sudo \
11+ build-essential \
12+ python3-dev \
13+ python3-pip \
14+ openssh-server
15+
16+ RUN make create_user
17+
18+ RUN mkdir /var/run/sshd
19+
20+ RUN rm -Rf /_build/
Original file line number Diff line number Diff line change 1+ SHELL := /bin/bash
2+
3+
4+ create_user :
5+ source scripts/build/create_user.sh
Original file line number Diff line number Diff line change 1+ #PythonPH
2+
3+ ## Prerequisites
4+ * Docker
5+ * Docker Compose
6+ * Git
7+
8+ ## Spinning a docker container
9+ ``` bash
10+ $ docker-compose -f compose/development.yml run -d --rm --name < name> --service-ports app
11+ ```
12+ ###### Notes:
13+ * Change ` name ` into what you want to call your container.
14+ * Update ` development.yml ` if there's conflicting with the ports.
Original file line number Diff line number Diff line change 1+ version : ' 2'
2+
3+ services :
4+ app :
5+ restart : always
6+ build :
7+ context : ../
8+ image : application
9+ volumes :
10+ - ../:/srv/src/app
11+ container_name : application
12+ working_dir : " /srv/src/app"
13+ command : scripts/docker_startup.sh
Original file line number Diff line number Diff line change 1+ version : ' 2'
2+
3+ services :
4+ app :
5+ extends :
6+ file : base.yml
7+ service : app
8+ container_name : development_app
9+ ports :
10+ - " 8080:8000"
11+ - " 2323:22"
Original file line number Diff line number Diff line change 1+ #! bin/bash
2+ SUDO_USER=happy
3+ SUDO_PASS=happy@1234
4+ APP_USER=caffeine
5+ APP_HOME=/srv/src
6+
7+ echo " ==> Creating sudo user '$SUDO_USER '"
8+ sudo useradd \
9+ --user-group \
10+ --no-create-home \
11+ --shell /bin/bash \
12+ $SUDO_USER
13+ echo $SUDO_USER :$SUDO_PASS | sudo chpasswd
14+ sudo adduser $SUDO_USER sudo
15+ echo " $SUDO_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/90-$SUDO_USER
16+
17+ echo " ==> Creating app user '$APP_USER '"
18+ sudo mkdir -p $APP_HOME
19+ sudo useradd \
20+ --shell /bin/bash \
21+ --user-group \
22+ --home-dir $APP_HOME \
23+ $APP_USER
24+ sudo chown $APP_USER : $APP_HOME
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ /usr/sbin/sshd -D
You can’t perform that action at this time.
0 commit comments