Skip to content

Commit 4e93687

Browse files
committed
Published docker images to Dockerhub
1 parent 0ea6f0b commit 4e93687

File tree

12 files changed

+154
-69
lines changed

12 files changed

+154
-69
lines changed

README.md

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,37 @@ We have packaged things up to run easily with [Vagrant](https://www.vagrantup.co
1818

1919
If anything in this guide is not accurate or if you run into any issues installing & running LaunchKit, please send us a pull request. No one is actively addressing bug reports, but we will happily review and integrate pull requests.
2020

21+
## Getting Started - Docker
22+
23+
### Step 1
24+
25+
Install Docker. You can find installation instructions at https://docs.docker.com/install/
26+
27+
### Step 2
28+
29+
Install Docker Compose. You can find installation instructions at https://docs.docker.com/compose/install/
30+
31+
### Step 3
32+
33+
Get the LaunchKit code and configure your LK settings.
34+
35+
$ git clone https://github.com/LaunchKit/LaunchKit.git
36+
$ cd LaunchKit
37+
38+
### Step 4
39+
40+
**NOTE 1.** Before running LaunchKit, you can edit `docker-compose.yml` file to change SMTP and SLACK configuration.
41+
42+
**NOTE 2.** In this step, you will be using prebuilt docker images from Docker Hub. You can build images on your own using `build_images.sh` script.
43+
44+
Run Launchkit
45+
46+
$ docker-compose up -d
47+
48+
### Step 5
49+
50+
Navigate to http://localhost:9100/
51+
2152
## Getting Started - Vagrant
2253

2354
Getting your LK instance up and running is fairly simple. This process has been tested thoroughly on **Mac OS 10.11**, but should also work on other systems compatible with Vagrant, VirtualBox and Ansible.
@@ -86,33 +117,6 @@ If you're never going to use LaunchKit again, you can destroy the machine altoge
86117

87118
$ vagrant destroy
88119

89-
## Getting Started - Docker
90-
91-
### Step 1
92-
93-
Install Docker. You can find installation instructions here: https://docs.docker.com/install/
94-
95-
### Step 2
96-
97-
Install Docker Compose. You can find installation instructions here: https://docs.docker.com/compose/install/
98-
99-
### Step 3
100-
101-
Get the LaunchKit code and configure your LK settings.
102-
103-
$ git clone https://github.com/LaunchKit/LaunchKit.git
104-
$ cd LaunchKit
105-
106-
### Step 4
107-
108-
Run Launchkit
109-
110-
$ docker-compose up -d
111-
112-
It might take some time to initialize all components.
113-
114-
Navigate to http://localhost:9100/
115-
116120
## System Configuration
117121

118122
LaunchKit will work largely out of the box, but each service has some **external dependencies** that you will need to configure if you wish the service to work properly.

backend/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
# If you want email to work, configure an SMTP server here.
3939

40-
EMAIL_SMTP_HOST = None # eg. "smtp.sendgrid.com"
40+
EMAIL_SMTP_HOST = None # eg. "smtp.sendgrid.com"
4141
EMAIL_SMTP_USER = None
4242
EMAIL_SMTP_PASSWORD = None
4343
EMAIL_FROM_DOMAIN = "yoursite.com"
@@ -105,7 +105,7 @@
105105
BETA_LINK_SECRET = '00000000000000000000000000000000' # must be 32 hex chars
106106
UNSUB_SUB_NOTIFY_SECRET = '00000000000000000000000000000000' # must be 32 hex chars
107107

108-
ENCRYPTED_ID_KEY_IV = '0000000000000000' # must be 16 hex chars
108+
ENCRYPTED_ID_KEY_IV = '0000000000000000' # must be 16 hex chars
109109

110110
COOKIE_SECRET_KEY = '00000000000000000000000000000000' # arbitrary secret
111111

build_images.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
VERSION=1.0.0
4+
# Docker gives by default 2gb of RAM for Docker containers
5+
# But building lxml library takes more memory and causes OOM,
6+
# This option helps speed up the build and avoid OOM
7+
MEMORY_LIMIT=4g
8+
9+
docker build -f docker/Dockerfile.base -t launchkit-base -m ${MEMORY_LIMIT} .
10+
docker build -f docker/Dockerfile.backend -t viktorkifer/launchkit-app:${VERSION} -m ${MEMORY_LIMIT} .
11+
docker build -f docker/Dockerfile.gae -t viktorkifer/launchkit-gae:${VERSION} -m ${MEMORY_LIMIT} .
12+
docker build -f docker/Dockerfile.reviews -t viktorkifer/launchkit-reviews:${VERSION} -m ${MEMORY_LIMIT} .
13+
docker build -f docker/Dockerfile.skit -t viktorkifer/launchkit-skit:${VERSION} -m ${MEMORY_LIMIT} .
14+
docker build -f docker/Dockerfile.postgres -t viktorkifer/viktorkifer/postgres-hstore:${VERSION} -m ${MEMORY_LIMIT} .
15+
docker rmi -f launchkit-base

docker-compose.yml

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
version: '2.1'
1+
version: '2.2'
2+
3+
networks:
4+
lk-shared:
5+
driver: local
26

37
volumes:
48
db-volume:
@@ -8,9 +12,7 @@ volumes:
812

913
services:
1014
backend:
11-
build:
12-
context: .
13-
dockerfile: docker/Dockerfile.backend
15+
image: viktorkifer/launchkit-app:1.0.0
1416
restart: unless-stopped
1517
environment:
1618
PORT: 9101
@@ -19,8 +21,17 @@ services:
1921
POSTGRES_PASSWORD: postgres
2022
POSTGRES_USER: postgres
2123
REDIS_URL: redis://redis:6379/0
22-
SECRET_KEY: CYtDmKetk7QbsCWgSyLWIRo1V57mGXsP
24+
SECRET_KEY: MySecretKey
2325
C_FORCE_ROOT: "true"
26+
# these are optional
27+
EMAIL_SMTP_HOST:
28+
EMAIL_SMTP_USER:
29+
EMAIL_SMTP_PASSWORD:
30+
EMAIL_FROM_DOMAIN: yoursite.com
31+
SLACK_CLIENT_ID:
32+
SLACK_CLIENT_SECRET:
33+
networks:
34+
- lk-shared
2435
depends_on:
2536
postgres:
2637
condition: service_healthy
@@ -37,12 +48,12 @@ services:
3748
retries: 6
3849

3950
gae:
40-
build:
41-
context: .
42-
dockerfile: docker/Dockerfile.gae
51+
image: viktorkifer/launchkit-gae:1.0.0
4352
restart: unless-stopped
4453
environment:
4554
SERVER_SOFTWARE: Dev
55+
networks:
56+
- lk-shared
4657
volumes:
4758
- gae-storage:/usr/src/app/.dev_gae_storage
4859
ports:
@@ -55,9 +66,7 @@ services:
5566
retries: 6
5667

5768
reviews:
58-
build:
59-
context: .
60-
dockerfile: docker/Dockerfile.reviews
69+
image: viktorkifer/launchkit-reviews:1.0.0
6170
restart: unless-stopped
6271
environment:
6372
PORT: 9101
@@ -66,24 +75,33 @@ services:
6675
POSTGRES_PASSWORD: postgres
6776
POSTGRES_USER: postgres
6877
REDIS_URL: redis://redis:6379/0
69-
SECRET_KEY: CYtDmKetk7QbsCWgSyLWIRo1V57mGXsP
78+
SECRET_KEY: MySecretKey
79+
# these are optional
80+
EMAIL_SMTP_HOST:
81+
EMAIL_SMTP_USER:
82+
EMAIL_SMTP_PASSWORD:
83+
EMAIL_FROM_DOMAIN: yoursite.com
84+
SLACK_CLIENT_ID:
85+
SLACK_CLIENT_SECRET:
86+
networks:
87+
- lk-shared
7088
depends_on:
7189
postgres:
7290
condition: service_healthy
7391
redis:
7492
condition: service_healthy
7593

7694
skit:
77-
build:
78-
context: .
79-
dockerfile: docker/Dockerfile.skit
95+
image: viktorkifer/launchkit-skit:1.0.0
8096
restart: unless-stopped
8197
environment:
8298
API_HOST: http://backend:9101/
8399
DEBUG: 'true'
84100
PORT: 9100
85101
depends_on:
86102
- backend
103+
networks:
104+
- lk-shared
87105
ports:
88106
- 9100:9100
89107
healthcheck:
@@ -95,17 +113,21 @@ services:
95113
redis:
96114
image: redis:4-alpine
97115
restart: unless-stopped
116+
networks:
117+
- lk-shared
98118
healthcheck:
99119
test: ["CMD", "redis-cli", "ping"]
100120
interval: 30s
101121
timeout: 10s
102122
retries: 3
103123

104124
postgres:
105-
image: aidanlister/postgres-hstore
125+
image: viktorkifer/postgres-hstore:1.0.0
106126
restart: unless-stopped
107127
ports:
108128
- 5432:5432
129+
networks:
130+
- lk-shared
109131
environment:
110132
POSTGRES_NAME: postgres
111133
POSTGRES_PASSWORD: postgres

docker/Dockerfile.backend

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
FROM python:2.7-alpine
1+
FROM launchkit-base
22

3-
RUN apk update && apk add make gcc libffi-dev musl-dev \
4-
postgresql-dev python-dev zlib-dev jpeg-dev libpng-dev libxml2-dev libxslt-dev go
3+
RUN apk --update add --no-cache go
54

6-
RUN mkdir -p /usr/src/app
7-
WORKDIR /usr/src/app
8-
9-
COPY requirements.txt /usr/src/app/
10-
RUN LIBRARY_PATH=/lib:/usr/lib pip install --no-cache-dir -r requirements.txt
11-
12-
COPY backend /usr/src/app/backend
135
COPY manage.py /usr/src/app
146
COPY devproxy.go devproxy.go
157
COPY docker/cmd.backend.sh /usr/src/app/

docker/Dockerfile.base

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM python:2.7-alpine
2+
3+
RUN apk --update add --no-cache make gcc libffi-dev musl-dev postgresql-dev \
4+
python-dev zlib-dev jpeg-dev libpng-dev libxml2-dev libxslt-dev
5+
6+
RUN mkdir -p /usr/src/app
7+
WORKDIR /usr/src/app
8+
9+
COPY requirements.txt /usr/src/app/
10+
RUN LIBRARY_PATH=/lib:/usr/lib pip install --no-cache-dir -r requirements.txt
11+
12+
COPY backend /usr/src/app/backend
13+

docker/Dockerfile.gae

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
FROM python:2.7-alpine
22

3-
RUN apk update && apk add build-base jpeg-dev zlib-dev wget unzip go
3+
RUN apk --update add --no-cache build-base jpeg-dev zlib-dev wget unzip go
44

55
RUN pip install Pillow
66

77
RUN wget https://storage.googleapis.com/appengine-sdks/featured/google_appengine_1.9.27.zip && unzip google_appengine_1.9.27.zip -d /usr/local && rm google_appengine_1.9.27.zip
88

99
ENV PATH="/usr/local/google_appengine:${PATH}"
1010

11-
COPY ansible/roles/lk-google-app-engine/files/home.appcfg_nag /.appcfg_nag
11+
COPY ansible/roles/lk-google-app-engine/files/home.appcfg_nag ~/.appcfg_nag
1212

1313
RUN mkdir -p /usr/src/app
1414
WORKDIR /usr/src/app

docker/Dockerfile.postgres

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM postgres:9.3-alpine
2+
MAINTAINER Viktor Kifer
3+
ADD docker/cmd.postgres.sh docker-entrypoint-initdb.d/cmd.postgres.sh

docker/Dockerfile.reviews

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
1-
FROM python:2.7-alpine
1+
FROM launchkit-base
22

3-
RUN apk update && apk add make gcc libffi-dev musl-dev postgresql-dev \
4-
python-dev zlib-dev jpeg-dev libpng-dev libxml2-dev libxslt-dev
5-
6-
RUN mkdir -p /usr/src/app
7-
WORKDIR /usr/src/app
8-
9-
COPY requirements.txt /usr/src/app/
10-
RUN LIBRARY_PATH=/lib:/usr/lib pip install --no-cache-dir -r requirements.txt
11-
12-
COPY backend /usr/src/app/backend
133
COPY review_ingester.py /usr/src/app
144
COPY docker/cmd.reviews.sh /usr/src/app/
155

docker/cmd.backend.sh

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,24 @@ sed -i "s|'USER': 'vagrant'|'USER': '${POSTGRES_USER}'|" backend/settings.py
99
sed -i "s|'PASSWORD': ''|'PASSWORD': '${POSTGRES_PASSWORD}'|" backend/settings.py
1010
sed -i "s|'HOST': 'localhost'|'HOST': '${POSTGRES_HOST}'|" backend/settings.py
1111

12-
# sed -i "s|APP_ENGINE_PHOTOS_UPLOAD_BASE_PATH = \"http://localhost:9102\"|APP_ENGINE_PHOTOS_UPLOAD_BASE_PATH = \"http://gae:9102\"|" backend/settings.py
12+
if [ -z "${EMAIL_SMTP_HOST}" ]; then
13+
sed -i "s|EMAIL_SMTP_HOST = None|'EMAIL_SMTP_HOST': '${EMAIL_SMTP_HOST}'|" backend/settings.py
14+
fi
15+
if [ -z "${EMAIL_SMTP_USER}" ]; then
16+
sed -i "s|EMAIL_SMTP_USER = None|'EMAIL_SMTP_USER': '${EMAIL_SMTP_USER}'|" backend/settings.py
17+
fi
18+
if [ -z "${EMAIL_SMTP_PASSWORD}" ]; then
19+
sed -i "s|EMAIL_SMTP_PASSWORD = None|'EMAIL_SMTP_PASSWORD': '${EMAIL_SMTP_PASSWORD}'|" backend/settings.py
20+
fi
21+
if [ -z "${EMAIL_FROM_DOMAIN}" ]; then
22+
sed -i "s|EMAIL_FROM_DOMAIN = \"yoursite.com\"|'EMAIL_SMTP_PASSWORD': '${EMAIL_FROM_DOMAIN}'|" backend/settings.py
23+
fi
24+
if [ -z "${SLACK_CLIENT_ID}" ]; then
25+
sed -i "s|SLACK_CLIENT_ID = \"\"|'SLACK_CLIENT_ID': '${SLACK_CLIENT_ID}'|" backend/settings.py
26+
fi
27+
if [ -z "${SLACK_CLIENT_SECRET}" ]; then
28+
sed -i "s|SLACK_CLIENT_SECRET = \"\"|'SLACK_CLIENT_SECRET': '${SLACK_CLIENT_SECRET}'|" backend/settings.py
29+
fi
1330

1431
# Fix Redis settings
1532
sed -i "s|redis://localhost:6379/0|${REDIS_URL}|" backend/settings.py

0 commit comments

Comments
 (0)