File tree Expand file tree Collapse file tree 8 files changed +79
-26
lines changed
Expand file tree Collapse file tree 8 files changed +79
-26
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ coverage
1313spec /tmp /*
1414.travis.yml
1515build_docker_image.sh
16+ Dockerfile
17+ docker-compose.yml
1618
1719# Copied from .gitignore
1820* .rbc
Original file line number Diff line number Diff line change 1- FROM ruby:2.6.6-slim
1+ FROM ruby:2.6.6-slim-buster
22
3- COPY docker/scripts/prepare /scripts/
4- RUN /scripts/prepare
3+ COPY docker/scripts/prepare_os /scripts/
4+ RUN /scripts/prepare_os
55
6- WORKDIR /app
7-
8- COPY ./ /app/
6+ VOLUME /var/lib/postgresql/11/main
97
10- ENV RAILS_ENV=production
8+ WORKDIR /app
119
12- # Get rid of annoying "fatal: Not a git repository (or any of the parent directories): .git" messages
13- RUN umask 002 && git init && \
14- LC_ALL=en_US.UTF-8 RAILS_ENV=production SECRET_KEY_BASE=secret bundle install --redownload --no-local -j 4 && \
15- LC_ALL=en_US.UTF-8 RAILS_ENV=production SECRET_KEY_BASE=secret bundle exec rake assets:clean assets:precompile && \
16- chmod g=u /app/Gemfile.lock /app/config/ /app/tmp/
10+ COPY --chown=active_workflow ./ /app/
1711
12+ RUN su active_workflow -c 'docker/scripts/prepare_app'
1813
1914EXPOSE 3000
2015
2116COPY docker/scripts/init /scripts/
22- CMD ["/scripts/init" ]
2317
24- USER 1001
18+ ENTRYPOINT [ "tini" , "--" , "/app/docker/scripts/entrypoint" ]
Original file line number Diff line number Diff line change @@ -37,8 +37,18 @@ entities that act on schedule or react to external triggers. These unsupervised
3737
3838## Getting Started
3939
40+
4041See the [ Getting Started wiki page] ( https://github.com/automaticmode/active_workflow/wiki/Getting-Started ) and follow the simple setup process.
4142
43+
44+ ## Try it with docker
45+
46+ ``` sh
47+ docker run -p 3000:3000 automaticmode/active_workflow
48+ ```
49+
50+ Once it starts you can login at [ http://localhost:3000 ] ( http://localhost:3000 ) with ` admin ` /` password ` .
51+
4252## Try it on Heroku
4353
4454A quick and easy way to check out ActiveWorkflow is by deploying it to
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ default: &default
66 username : <%= ENV['DATABASE_USERNAME'].presence || "active_workflow" %>
77 host : <%= ENV['DATABASE_HOST'] || 'localhost' %>
88 port : <%= ENV['DATABASE_PORT'] || 5432 %>
9- socket : <%= ENV['DATABASE_SOCKET'] || "" %>
109 password : <%= ENV['DATABASE_PASSWORD'] || "myactiveworkflowpassword" %>
1110 strict : false
1211
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+
4+ export RAILS_ENV=production
5+
6+ # Start internal postgres if no database is configured.
7+ if [ -z " ${DATABASE_HOST} " ] && [ -z " ${DATABASE_URL} " ]; then
8+ /etc/init.d/postgresql start
9+ echo -n ' Waiting for postgres to be ready'
10+ until runuser -l postgres -c ' pg_isready' 2> /dev/null; do
11+ sleep 1; echo -n ' .'
12+ done
13+ echo ' done.'
14+ runuser -l postgres -c ' createuser --createdb active_workflow || true'
15+ # Use domain socket to connect to postgres.
16+ export DATABASE_URL=postgres:///active_workflow
17+ export DATABASE_HOST=' '
18+ export DATABASE_USERNAME=' '
19+ export DATABASE_PASSWORD=' '
20+ export CREATE_DATABASE=${CREATE_DATABASE:- true}
21+ # Only use one container when running with internal database.
22+ export SINGLE_DYNO=1
23+ fi
24+
25+ if [ -n " $1 " ]; then
26+ CMD=$1
27+ shift
28+ else
29+ CMD=docker/scripts/init
30+ fi
31+
32+ # Drop root and execute startup script with normal permissions.
33+ exec setpriv --reuid active_workflow --clear-groups $CMD " $@ "
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -e
33
4+ # Environment defaults
5+ export DISABLE_SSL=${DISABLE_SSL:- true}
6+
47cd /app
58
69# Cleanup any leftover pid file
710if [ -f /app/tmp/pids/server.pid ]; then
811 rm /app/tmp/pids/server.pid
912fi
1013
14+ if [ -z " ${SECRET_KEY_BASE} " ]; then
15+ echo ' WARNING: Please set SECRET_KEY_BASE to a random string, using "change me!" for this run.'
16+ export SECRET_KEY_BASE=' change me!'
17+ fi
18+
1119# The database may need to start up for a bit first
1220if [ -n " ${INTENTIONALLY_SLEEP} " ]; then
1321 echo " Intentionally sleeping ${INTENTIONALLY_SLEEP} "
1422 sleep ${INTENTIONALLY_SLEEP}
1523fi
16-
17-
1824if [ -n " ${DATABASE_INITIAL_CONNECT_MAX_RETRIES} " ]; then
1925 max=${DATABASE_INITIAL_CONNECT_MAX_RETRIES}
2026 count=0
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+
4+ umask 002
5+ gem install bundler
6+ bundle config set no-cache ' true'
7+ bundle config set without ' test development'
8+ bundle config set deployment ' true'
9+ LC_ALL=en_US.UTF-8 RAILS_ENV=production SECRET_KEY_BASE=secret bundle install --redownload --no-local -j 4
10+ LC_ALL=en_US.UTF-8 RAILS_ENV=production SECRET_KEY_BASE=secret bundle exec rake assets:clean assets:precompile
11+ chmod g=u /app/Gemfile.lock /app/config/ /app/tmp/
Original file line number Diff line number Diff line change @@ -22,22 +22,20 @@ $minimal_apt_get_install build-essential git-core \
2222 zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev \
2323 libncurses5-dev libffi-dev libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev \
2424 graphviz libgraphviz-dev \
25- libpq-dev libsqlite3-dev tzdata
25+ libpq-dev libsqlite3-dev tzdata \
26+ postgresql-11 tini
2627
2728apt-get purge -y python3* rsyslog rsync manpages
2829apt -y autoremove
2930apt-get -y clean
3031
31- gem install bundler
32- bundle config set no-cache ' true'
33- bundle config set without ' test development'
34- bundle config set deployment ' true'
35-
36- mkdir -p /app
37- chmod -R g=u /etc/passwd /app
38-
3932rm -rf /var/lib/apt/lists/*
4033rm -rf /usr/share/doc/
4134rm -rf /usr/share/man/
4235rm -rf /usr/share/locale/
4336rm -rf /var/log/*
37+
38+ useradd --home-dir /app --no-create-home --no-log-init active_workflow
39+ mkdir -p /app
40+ chown -R active_workflow /app
41+ chmod 700 /app
You can’t perform that action at this time.
0 commit comments