Skip to content

Commit 4d968a1

Browse files
authored
Merge pull request #3106 from kinduff/docker_demo
Enable Docker for demoing purposes
2 parents 463e98e + e12e9ff commit 4d968a1

File tree

4 files changed

+66
-0
lines changed

4 files changed

+66
-0
lines changed

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ Try out Solidus with one-click on Heroku:
6666

6767
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/solidusio/solidus)
6868

69+
Alternatively, you can use Docker to run a demo on your local machine. Run the
70+
following command to download the image and run it at
71+
[http://localhost:3000](http://localhost:3000).
72+
73+
```
74+
docker run --rm -it -p 3000:3000 solidusio/solidus-demo:latest
75+
```
76+
77+
The admin interface can be accessed at
78+
[http://localhost:3000/admin/](http://localhost:3000/admin/), the default
79+
credentials are `admin@example.com` and `test123`.
80+
6981
## Getting started
7082

7183
Begin by making sure you have

lib/demo/Dockerfile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#
2+
# This image is intended to be used to test and demo Solidus
3+
# it is not intended for production purposes
4+
#
5+
FROM ruby:2.5.1
6+
7+
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
8+
9+
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
10+
11+
RUN mkdir /solidus
12+
13+
WORKDIR /solidus
14+
15+
ADD . /solidus
16+
17+
RUN bundle install
18+
19+
RUN bundle exec rake sandbox
20+
21+
CMD ["sh", "./lib/demo/docker-entrypoint.sh"]

lib/demo/README.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Solidus Docker Demo
2+
The Dockerfile in this folder is intended for demoing purposes, meaning that a
3+
user can run an installation of Solidus using a Docker container.
4+
5+
## How to build the image
6+
Make sure Docker is installed in your local and run the following command:
7+
8+
```shell
9+
docker build -t solidusio/solidus-demo:latest -f lib/demo/Dockerfile .
10+
```
11+
12+
## How to run the image
13+
You can either run the image you built locally or run the official image pushed
14+
in Dockerhub.
15+
16+
```shell
17+
docker run --rm -it -p 3000:3000 solidusio/solidus-demo:latest
18+
```
19+
20+
## How to push the image
21+
If you want to push the image you can use the following command, just note that
22+
this specific command will push the image to the official Solidus Dockerhub
23+
account.
24+
25+
```shell
26+
docker push solidusio/solidus-demo:latest
27+
```

lib/demo/docker-entrypoint.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
export RAILS_ENV=development
4+
5+
cd sandbox && \
6+
bundle exec rails s -p 3000 -b '0.0.0.0'

0 commit comments

Comments
 (0)