mirror of
https://github.com/sergeyyarkov/educt-server.git
synced 2026-10-11 02:09:07 +03:00
readme
This commit is contained in:
parent
793d7d650a
commit
b1965eeeda
14
Makefile
14
Makefile
@ -1,14 +0,0 @@
|
||||
build:
|
||||
docker-compose -f docker-compose.yml build $(c)
|
||||
up:
|
||||
docker-compose -f docker-compose.yml up -d $(c)
|
||||
down:
|
||||
docker-compose -f docker-compose.yml down $(c)
|
||||
stop:
|
||||
docker-compose -f docker-compose.yml stop $(c)
|
||||
logs:
|
||||
docker-compose -f docker-compose.yml logs --tail=100 -f $(c)
|
||||
migrate:
|
||||
docker-compose -f docker-compose.yml run api npm run db:migrate:force
|
||||
seed:
|
||||
docker-compose -f docker-compose.yml run api npm run db:seed
|
||||
@ -1,3 +1,8 @@
|
||||
# About API
|
||||
# educt-server
|
||||
|
||||
...
|
||||
_This service is part of [Educt](https://github.com/sergeyyarkov/educt) which contains API application._
|
||||
|
||||
<!-- ## Requirements
|
||||
|
||||
- NodeJS >= 14.17.3
|
||||
- Docker -->
|
||||
|
||||
@ -1,97 +0,0 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
nginx:
|
||||
container_name: nginx
|
||||
restart: always
|
||||
image: nginx:latest
|
||||
volumes:
|
||||
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
|
||||
ports:
|
||||
- 80:80
|
||||
depends_on:
|
||||
- api
|
||||
networks:
|
||||
- app-network
|
||||
client:
|
||||
container_name: client
|
||||
restart: always
|
||||
image: educt-client
|
||||
ports:
|
||||
- 5000:80
|
||||
depends_on:
|
||||
- api
|
||||
networks:
|
||||
- app-network
|
||||
api:
|
||||
container_name: api
|
||||
restart: always
|
||||
build:
|
||||
context: .
|
||||
target: production
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- ${PORT}:${PORT}
|
||||
environment:
|
||||
- PORT=3333
|
||||
- APP_KEY=IP387l45rlNO3t7Qgjd89qr-a2G4oUgz
|
||||
- DB_CONNECTION=pg
|
||||
- PG_HOST=postgres
|
||||
- PG_PORT=5432
|
||||
- PG_USER=postgres
|
||||
- PG_PASSWORD=1234
|
||||
- PG_DB_NAME=educt
|
||||
- REDIS_CONNECTION=local
|
||||
- REDIS_HOST=redis
|
||||
- REDIS_PORT=6379
|
||||
- REDIS_PASSWORD=
|
||||
- SMTP_HOST=localhost
|
||||
- SMTP_PORT=587
|
||||
- SMTP_USERNAME=<username>
|
||||
- SMTP_PASSWORD=<password>
|
||||
- MAILGUN_API_KEY=<key>
|
||||
- MAILGUN_DOMAIN=<domain>
|
||||
- CACHE_VIEWS=false
|
||||
- DRIVE_DISK=local
|
||||
- S3_KEY=<key>
|
||||
- S3_SECRET=<secret>
|
||||
- S3_BUCKET=<bucket>
|
||||
- S3_REGION=<region>
|
||||
volumes:
|
||||
- uploads:/home/node/app/uploads
|
||||
command: ['dumb-init', 'node', 'server.js']
|
||||
depends_on:
|
||||
- postgres
|
||||
networks:
|
||||
- app-network
|
||||
postgres:
|
||||
container_name: postgres
|
||||
image: postgres:14
|
||||
volumes:
|
||||
- postgres_volume:/var/lib/postgresql/data
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: 1234
|
||||
POSTGRES_DB: educt
|
||||
ports:
|
||||
- 5432:5432
|
||||
networks:
|
||||
- app-network
|
||||
redis:
|
||||
container_name: redis
|
||||
image: redis:6-alpine
|
||||
volumes:
|
||||
- redis_volume:/data
|
||||
ports:
|
||||
- 6379:6379
|
||||
networks:
|
||||
- app-network
|
||||
depends_on:
|
||||
- postgres
|
||||
volumes:
|
||||
postgres_volume:
|
||||
redis_volume:
|
||||
uploads:
|
||||
networks:
|
||||
app-network:
|
||||
driver: bridge
|
||||
@ -1,29 +0,0 @@
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
proxy_pass http://client:80;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
}
|
||||
|
||||
location /api {
|
||||
proxy_pass http://api:3333;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user