Skip to content

Commit 9475c20

Browse files
committed
Add docker-compose.yml and document how to run the site in Docker.
Part of #534 [ci skip]
1 parent aa407d5 commit 9475c20

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

docker/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Run MyStamps in Docker
2+
3+
MyStamps application can be run as a Docker container. While there are many
4+
possible configurations, we support only those that are typically used:
5+
6+
* **a single container** where the application is running with `test` profile.
7+
In this mode, it also runs in-memory database H2. This is roughly the same as
8+
executing `mvn spring-boot:run` command but inside a Docker container.
9+
10+
* Build a WAR file that will be used in container building:
11+
```console
12+
$ mvn package
13+
$ cd docker
14+
$ ln -v ../target/mystamps.war mystamps.war
15+
```
16+
By the way, don't forget to remove this hard link after using.
17+
* Build an image and run a container with `docker-compose`:
18+
```console
19+
$ docker-compose up -d
20+
```
21+
* The same but with a plain Docker:
22+
```console
23+
$ docker build -t mystamps:latest .
24+
$ docker run -d -p 8080:8080 mystamps:latest
25+
```
26+

docker/docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: '3'
2+
3+
services:
4+
web:
5+
build: ./
6+
ports: [ "8080:8080" ]

0 commit comments

Comments
 (0)