Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add common docker-compose file for both front and back
- Loading branch information
1 parent
89d03ac
commit 64bbcb7
Showing
4 changed files
with
61 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.idea/ | ||
back/target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
## Run dev env | ||
1. Install Docker and docker-compose | ||
2. run this command (from project root): | ||
```console | ||
docker-compose up -d | ||
``` | ||
3. To clear the env run: | ||
```console | ||
docker-compose down | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
version: '3.4' | ||
|
||
services: | ||
postgres: | ||
image: postgres:13.2-alpine | ||
restart: always | ||
volumes: | ||
- ./back/migrations/:/docker-entrypoint-initdb.d/ | ||
ports: | ||
- "5432:5432" | ||
environment: | ||
POSTGRES_PASSWORD: hh | ||
POSTGRES_DB: hh | ||
POSTGRES_USER: hh | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -U hh"] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
back: | ||
image: maven:3.6.3-jdk-11 | ||
restart: always | ||
working_dir: /mnt/app | ||
command: mvn install exec:java | ||
volumes: | ||
- gowork-back-maven-repo:/root/.m2 | ||
- ./back:/mnt/app:Z | ||
ports: | ||
- "8080:8080" | ||
links: | ||
- postgres | ||
depends_on: | ||
- postgres | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:8080/status"] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
start_period: 180s # first start may be long due to downloading dependencies | ||
front: | ||
build: ./front | ||
ports: | ||
- "3000:80" | ||
links: | ||
- back | ||
depends_on: | ||
- back | ||
volumes: | ||
gowork-back-maven-repo: |