added additional config and docs
This commit is contained in:
@@ -0,0 +1,67 @@
|
|||||||
|
# Docker
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
You have created a `docker-compose.override.yml` file in the root directory of this repository.
|
||||||
|
|
||||||
|
## Docker Network
|
||||||
|
|
||||||
|
If you want to run the stack in a docker network, you need to change the `BACKEND_HOST` variable in the root `.env` file to `stockhome-backend`. To add a docker network, create a `docker-compose.override.yml` file in the root directory of this repository with the following content:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
database:
|
||||||
|
networks:
|
||||||
|
- stockhome-network
|
||||||
|
|
||||||
|
backend:
|
||||||
|
networks:
|
||||||
|
- stockhome-network
|
||||||
|
|
||||||
|
frontend:
|
||||||
|
networks:
|
||||||
|
- stockhome-network
|
||||||
|
|
||||||
|
networks:
|
||||||
|
stockhome-network:
|
||||||
|
driver: bridge
|
||||||
|
```
|
||||||
|
|
||||||
|
To start off I recommend to set the `BACKEND_HOST` variable to `localhost` and start the stack without a docker network. After you have started the stack and everything is working, you can add a docker network.
|
||||||
|
|
||||||
|
## Ports
|
||||||
|
|
||||||
|
### Change Exposed Ports
|
||||||
|
|
||||||
|
If you want to change the exposed ports, you can do this in the `docker-compose.yml` file like so:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
database:
|
||||||
|
ports:
|
||||||
|
- "3306:3306"
|
||||||
|
|
||||||
|
backend:
|
||||||
|
ports:
|
||||||
|
- "8004:8004"
|
||||||
|
|
||||||
|
frontend:
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Remove Exposed Ports
|
||||||
|
|
||||||
|
If you want to remove the exposed ports, you can do this in the `docker-compose.override.yml` file like so:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
database:
|
||||||
|
ports: !override []
|
||||||
|
|
||||||
|
backend:
|
||||||
|
ports: !override []
|
||||||
|
|
||||||
|
frontend:
|
||||||
|
ports: !override []
|
||||||
|
```
|
||||||
+2
-1
@@ -47,4 +47,5 @@ ToDo.txt
|
|||||||
.env
|
.env
|
||||||
.docker/volumes
|
.docker/volumes
|
||||||
.tanstack/tmp
|
.tanstack/tmp
|
||||||
local/
|
local/
|
||||||
|
docker-compose.override.yml
|
||||||
@@ -46,6 +46,8 @@ If you haven't installed git, download the source code from this repository from
|
|||||||
|
|
||||||
**OR**
|
**OR**
|
||||||
|
|
||||||
|
_Recommended because it is easier to update then_
|
||||||
|
|
||||||
If you want to be always up to date, you can clone this repository by running:
|
If you want to be always up to date, you can clone this repository by running:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -61,11 +63,16 @@ In the root directory of this repository create an .env file and enter the follo
|
|||||||
```txt
|
```txt
|
||||||
MYSQL_ROOT_PASSWORD=
|
MYSQL_ROOT_PASSWORD=
|
||||||
AUTH_SIGNATURE=
|
AUTH_SIGNATURE=
|
||||||
|
BACKEND_HOST=localhost
|
||||||
```
|
```
|
||||||
|
|
||||||
Make sure that you have set an secure root password and a secure signature.
|
Make sure that you have set an secure root password and a secure signature.
|
||||||
|
|
||||||
> **NOTE:** These two values cannot contain special characters.
|
> **NOTE:** These three values cannot contain special characters.
|
||||||
|
|
||||||
|
The host can be set to the IP address of your server or to `localhost` if you are running the app on your local machine.
|
||||||
|
|
||||||
|
> **Change Docker Config:** If you want to run the stack for example in a docker network or want to change something at the docker config, visit the [Docker docs](./.github/docs/docker/README.md) for this project.
|
||||||
|
|
||||||
### 4. Start Stockhome
|
### 4. Start Stockhome
|
||||||
|
|
||||||
@@ -88,6 +95,19 @@ Password: admin
|
|||||||
|
|
||||||
_Keep in mind that you should change the password later in the settings page._
|
_Keep in mind that you should change the password later in the settings page._
|
||||||
|
|
||||||
|
> **NOTE:** If errors occur get yourself some help in the [error code page](./.github/docs/error/README.md).
|
||||||
|
|
||||||
|
> _I'd be grateful if you could report any bugs as issues here in the repository!_
|
||||||
|
|
||||||
|
## Update
|
||||||
|
|
||||||
|
To update the stack, navigate into the root directory of this repository and run:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
docker compose pull
|
||||||
|
docker compose up -d --build
|
||||||
|
```
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|||||||
+6
-1
@@ -21,6 +21,8 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: ./backend
|
context: ./backend
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
ports:
|
||||||
|
- "8004:8004"
|
||||||
environment:
|
environment:
|
||||||
DB_HOST: stockhome-mysql
|
DB_HOST: stockhome-mysql
|
||||||
DB_USER: root
|
DB_USER: root
|
||||||
@@ -35,9 +37,12 @@ services:
|
|||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
container_name: stockhome-frontend
|
container_name: stockhome-frontend
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
build: ./frontend
|
build: ./frontend
|
||||||
environment:
|
environment:
|
||||||
VITE_BACKEND_URL: http://localhost:8004
|
HOST: ${BACKEND_HOST}
|
||||||
|
VITE_BACKEND_URL: /backend
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
location /backend/ {
|
location /backend/ {
|
||||||
proxy_pass http://stockhome-backend:8004/;
|
proxy_pass http://${BACKEND_HOST}:8004/;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~* \.(?:js|mjs|css|png|jpg|jpeg|gif|ico|svg|woff2?)$ {
|
location ~* \.(?:js|mjs|css|png|jpg|jpeg|gif|ico|svg|woff2?)$ {
|
||||||
|
|||||||
Reference in New Issue
Block a user