-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: configure production deploy docker
- Loading branch information
1 parent
ce6b4d1
commit c17131c
Showing
7 changed files
with
94 additions
and
4 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
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
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,46 @@ | ||
version: "3" | ||
|
||
services: | ||
web: | ||
image: nginx:latest | ||
container_name: web-nginx | ||
ports: | ||
- "80:80" | ||
volumes: | ||
- ./web-app/build:/var/www/html | ||
- ./ngnix/config/default.conf:/etc/nginx/conf.d/default.conf | ||
depends_on: | ||
- api-service | ||
|
||
database-service: | ||
image: postgres:10 | ||
container_name: app-database | ||
environment: | ||
- POSTGRES_DB=adonis_db | ||
- POSTGRES_DB_TEST=adonis_db_teste | ||
- POSTGRES_USER=adonis_usr | ||
- POSTGRES_PASSWORD=123456 | ||
ports: | ||
- "5432:5432" | ||
expose: | ||
- "5432" | ||
volumes: | ||
- ./database/docker-data/postgres:/var/lib/postgresql/data | ||
# - ./database/schema.sql:/docker-entrypoint-initdb.d/0.schema.sql | ||
#- ./database/initial-data.sql:/docker-entrypoint-initdb.d/1.data.sql | ||
|
||
api-service: | ||
build: | ||
context: ./api | ||
dockerfile: Dockerfile | ||
container_name: app-api | ||
volumes: | ||
- ./api:/api | ||
command: sh -c "npm start" | ||
ports: | ||
- "8080:8080" | ||
environment: | ||
- DB_HOST=app-database | ||
- DB_PORT=5432 | ||
depends_on: | ||
- database-service |
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
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,31 @@ | ||
echo "************* [REACT-DONIS-STARTER] *************" | ||
|
||
echo "****** [CHANGELOG CONVENTION] ****** [CONFIGURING PROJECT] ******" | ||
echo "\n" | ||
npm install | ||
|
||
|
||
echo "****** [API DEPEDENCES] ****** [CONFIGURING PROJECT] ******" | ||
echo "\n" | ||
|
||
cd ./api | ||
cp .env.example .env | ||
adonis key:generate | ||
npm install | ||
cd .. | ||
|
||
|
||
echo "****** [WEB-APP DEPEDENCES] ****** [CONFIGURING PROJECT] ******" | ||
echo "\n" | ||
cd ./web-app | ||
npm install | ||
npm run build | ||
cd .. | ||
|
||
|
||
echo "****** [DOCKER] ****** [CONFIGURING PROJECT] ******" | ||
echo "\n" | ||
|
||
cp docker-compose.prod.example docker-compose.yml | ||
|
||
docker-compose up |
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,12 @@ | ||
server { | ||
listen 80; | ||
index index.html; | ||
server_name localhost; | ||
error_log /var/log/nginx/error.log; | ||
access_log /var/log/nginx/access.log; | ||
root /var/www/html; | ||
|
||
location / { | ||
try_files $uri /index.html =404; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.