Skip to content

Commit 5154e1f

Browse files
author
Vidas P
committed
Fix docker flow and documentation (#1)
1 parent e6ba256 commit 5154e1f

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,8 @@ Tests can be run with `make test`.
466466

467467
### Running Locally with Docker
468468

469-
You can test the docker container you just built locally. Run it (with a PostgreSQL database in a separate container):
469+
You can test ActiveWorkflow using docker locally. Run it (with a PostgreSQL
470+
database in a separate container):
470471

471472
```sh
472473
docker-compose up

docker-compose.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ services:
1313
POSTGRES_USER: active_workflow
1414

1515
active_workflow:
16-
image: local/active_workflow
16+
build:
17+
context: .
18+
dockerfile: Dockerfile
1719
env_file:
1820
- .env
1921
environment:

docker/test/Dockerfile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
FROM local/active_workflow
1+
FROM ruby:2.6.3-slim
22

33
USER 0
44

5+
COPY docker/scripts/prepare /scripts/
6+
RUN /scripts/prepare
7+
58
RUN apt-get update && \
69
apt-get -y install \
710
build-essential \
@@ -18,13 +21,18 @@ RUN apt-get update && \
1821
libfontconfig1-dev curl && \
1922
apt-get -y clean
2023

21-
RUN LC_ALL=en_US.UTF-8 bundle install --with test development --path vendor/bundle -j 4
24+
WORKDIR /app
25+
26+
COPY ./ /app/
27+
28+
RUN LC_ALL=en_US.UTF-8 umask 002 && bundle install --with test development --path vendor/bundle -j 4
2229

23-
COPY docker/test/scripts/test_env /scripts/
30+
COPY ["docker/scripts/setup_env", "docker/scripts/init", "docker/test/scripts/test_env", "/scripts/"]
31+
32+
EXPOSE 3000
2433

25-
# Override upstream script with the local one.
26-
COPY docker/scripts/setup_env /scripts/
2734
ENTRYPOINT ["/scripts/test_env"]
2835
CMD ["rake spec"]
2936

3037
USER 1001
38+

0 commit comments

Comments
 (0)