Skip to content

Commit

Permalink
add common docker-compose file for both front and back
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitakalyanov authored and samnix-p committed Apr 6, 2021
1 parent 89d03ac commit 64bbcb7
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 21 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1 +1,2 @@
.idea/
back/target/
10 changes: 10 additions & 0 deletions README.md
@@ -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
```
21 changes: 0 additions & 21 deletions back/docker-compose.yaml

This file was deleted.

50 changes: 50 additions & 0 deletions docker-compose.yaml
@@ -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:

0 comments on commit 64bbcb7

Please sign in to comment.