File tree 8 files changed +79
-26
lines changed
8 files changed +79
-26
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ coverage
13
13
spec /tmp /*
14
14
.travis.yml
15
15
build_docker_image.sh
16
+ Dockerfile
17
+ docker-compose.yml
16
18
17
19
# Copied from .gitignore
18
20
* .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
2
2
3
- COPY docker/scripts/prepare /scripts/
4
- RUN /scripts/prepare
3
+ COPY docker/scripts/prepare_os /scripts/
4
+ RUN /scripts/prepare_os
5
5
6
- WORKDIR /app
7
-
8
- COPY ./ /app/
6
+ VOLUME /var/lib/postgresql/11/main
9
7
10
- ENV RAILS_ENV=production
8
+ WORKDIR /app
11
9
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/
17
11
12
+ RUN su active_workflow -c 'docker/scripts/prepare_app'
18
13
19
14
EXPOSE 3000
20
15
21
16
COPY docker/scripts/init /scripts/
22
- CMD ["/scripts/init" ]
23
17
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
37
37
38
38
## Getting Started
39
39
40
+
40
41
See the [ Getting Started wiki page] ( https://github.com/automaticmode/active_workflow/wiki/Getting-Started ) and follow the simple setup process.
41
42
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
+
42
52
## Try it on Heroku
43
53
44
54
A 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
6
6
username : <%= ENV['DATABASE_USERNAME'].presence || "active_workflow" %>
7
7
host : <%= ENV['DATABASE_HOST'] || 'localhost' %>
8
8
port : <%= ENV['DATABASE_PORT'] || 5432 %>
9
- socket : <%= ENV['DATABASE_SOCKET'] || "" %>
10
9
password : <%= ENV['DATABASE_PASSWORD'] || "myactiveworkflowpassword" %>
11
10
strict : false
12
11
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 1
1
#! /bin/bash
2
2
set -e
3
3
4
+ # Environment defaults
5
+ export DISABLE_SSL=${DISABLE_SSL:- true}
6
+
4
7
cd /app
5
8
6
9
# Cleanup any leftover pid file
7
10
if [ -f /app/tmp/pids/server.pid ]; then
8
11
rm /app/tmp/pids/server.pid
9
12
fi
10
13
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
+
11
19
# The database may need to start up for a bit first
12
20
if [ -n " ${INTENTIONALLY_SLEEP} " ]; then
13
21
echo " Intentionally sleeping ${INTENTIONALLY_SLEEP} "
14
22
sleep ${INTENTIONALLY_SLEEP}
15
23
fi
16
-
17
-
18
24
if [ -n " ${DATABASE_INITIAL_CONNECT_MAX_RETRIES} " ]; then
19
25
max=${DATABASE_INITIAL_CONNECT_MAX_RETRIES}
20
26
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 \
22
22
zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev \
23
23
libncurses5-dev libffi-dev libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev \
24
24
graphviz libgraphviz-dev \
25
- libpq-dev libsqlite3-dev tzdata
25
+ libpq-dev libsqlite3-dev tzdata \
26
+ postgresql-11 tini
26
27
27
28
apt-get purge -y python3* rsyslog rsync manpages
28
29
apt -y autoremove
29
30
apt-get -y clean
30
31
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
-
39
32
rm -rf /var/lib/apt/lists/*
40
33
rm -rf /usr/share/doc/
41
34
rm -rf /usr/share/man/
42
35
rm -rf /usr/share/locale/
43
36
rm -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