Skip to content

Commit

Permalink
XMerge branch 'develop' of https://github.com/nixrod/wichtel-tracker
Browse files Browse the repository at this point in the history
…into develop
  • Loading branch information
nixrod committed Nov 30, 2022
2 parents 3130d4e + b10ebba commit 6e8ebdd
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 57 deletions.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ Configure the .env file with your secrets.
### 2. Start docker compose

This starts the backend and mysql database in detached mode.
```
```sh
docker-compose up -d
```

### 3. Initialize the database

First adapt the db password in the sql-init.sql file according to the .env file
**First adapt the db password in the sql-init.sql file according to the .env file**

Option 1:
```
```sh
# Either connect to the docker container with preinstalled mysql
docker exec -it <container_id> /bin/bash

Expand All @@ -35,32 +35,33 @@ mysql -h 127.0.0.1 -uroot -p wichtel
```

Option 2:
```
```sh
# Directly execute the script. Requires mysql installed on os level
mysql -h 127.0.0.1 -uroot -p wichtel <sql-init.sql
```

### 4. Pick which component to work on

#### Webapp
```
```sh
cd webapp
npm install
npm run start
```
Make sure that you set the prod environment variables before deployment on a server.

#### Backend
```
```sh
cd backend
docker stop wichtel-tracker_web_1
DB_PW=<see .env> HOST=localhost npm run start
```

## 🏃 Deploy on prod environment

1. Clone git repository
2. Follow Steps 1-3 above to run docker-compose in production
1. Adapt the backend hostname in the frontend app prod env variables and build and push the docker images
2. Clone git repository
3. Follow Steps 1-3 above to run docker-compose in production

## 🔨 Continuous Integration
A github action exists, which automatically builds and pushes the docker
Expand All @@ -69,12 +70,12 @@ Commits tagged with vX.X.X are published as releases.

### Manual Build and Push
#### Build
```
```sh
docker build -t ghcr.io/nixrod/wichtel-tracker .
```

#### Push to container registry
```
```sh
docker push ghcr.io/nixrod/wichtel-tracker
```

Expand Down
46 changes: 0 additions & 46 deletions backend/db-init.sql

This file was deleted.

3 changes: 3 additions & 0 deletions sql-init.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
############################################################
# ADAPT the root password here before executing the script #
############################################################
ALTER USER 'root' IDENTIFIED WITH mysql_native_password BY 'my-secret-pw';
flush privileges;

Expand Down
2 changes: 1 addition & 1 deletion webapp/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const environment = {
production: true,
host: '164.92.247.35',
host: 'wichtel.happelitos.tk',
port: 80
};

0 comments on commit 6e8ebdd

Please sign in to comment.