-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (49 loc) 路 1.44 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!make
# prefix for info messages
ECHO_PREFIX := 馃敡
# installs dependencies
init:
@echo "$(ECHO_PREFIX) Installing dependencies..."
npm install
# removes installed dependencies
clean:
@echo "$(ECHO_PREFIX) Cleaning project..."
rm -rf node_modules
# starts the postgresql service
db-start:
@echo "$(ECHO_PREFIX) Starting database service..."
pg_ctl -D /usr/local/var/postgres start
# stops the postgresql service
db-stop:
@echo "$(ECHO_PREFIX) Stopping database service..."
pg_ctl -D /usr/local/var/postgres stop
# creates the db with the defined tables
db-create:
@echo "$(ECHO_PREFIX) Creating new database 'hackerbox-sandbox'..."
psql postgres < localbox/schema.sql
# starts the backend locally
backend:
@echo "$(ECHO_PREFIX) Starting backend service..."
npm run backend
# starts the frontend locally
frontend:
@echo "$(ECHO_PREFIX) Starting frontend service..."
npm run frontend
# run app in local container
docker-start:
@echo "$(ECHO_PREFIX) Starting Docker container..."
docker-compose up
# stops the app's container
docker-stop:
@echo "$(ECHO_PREFIX) Stopping Docker container..."
docker-compose stop
@echo "$(ECHO_PREFIX) Removing Docker container..."
docker-compose rm -f
# removes the docker image
docker-clean: docker-stop
@echo "$(ECHO_PREFIX) Removing Docker image..."
docker-compose down --rmi all
# build the docker image again
docker-build: docker-stop
@echo "$(ECHO_PREFIX) Building Docker image..."
docker-compose build