Skip to content

Commit da78362

Browse files
committed
docs: update docker-compose information
1 parent c74ea28 commit da78362

File tree

3 files changed

+60
-46
lines changed

3 files changed

+60
-46
lines changed

Diff for: docker-compose.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
version: '3.0'
22
services:
33
streetmerchant:
4+
image: ghcr.io/jef/streetmerchant:latest
45
build:
56
context: .
67
dockerfile: Dockerfile
78
container_name: streetmerchant
8-
env_file: .env
9-
# ports:
10-
# - 7997:7997
9+
env_file:
10+
- dotenv

Diff for: docs/docker.md

-25
Original file line numberDiff line numberDiff line change
@@ -1,25 +0,0 @@
1-
# Docker
2-
3-
You will need:
4-
* `docker` (tested on Docker version 19.03.13-ce, build 4484c46d9d)
5-
* `make` (not a strict requirement, but helps out with stages)
6-
* `docker-compose` (tested on docker-compose version 1.27.4,)
7-
8-
## What
9-
It is assumed you know what docker is.
10-
You can build and run this project inside docker, headless. All the depencies will be downloaded in to the docker image.
11-
12-
## Why
13-
There is no need to install node, or anything else (apart from above) on your machine to run this.
14-
15-
## How
16-
17-
1. Copy pasta the `.env-example` in to `.env`.
18-
2. Edit `.env` in your favourite editor, pick stores, options what ever you want.
19-
3. If you have make, simply run `make` in your terminal to get started. You should see a docker build, and container start automatically.
20-
4. If you want a webserver running, so you can edit the options via web interface, uncomment lines 13-14 in `docker-compose.yml` to open up ports `7997`. Update `.env` file `WEB_PORT="7997"` this is so the service listens on `7997` and we expose the same ports on docker.
21-
5. If you do not have make, because windows, run these commands in order:
22-
```
23-
docker-compose build streetmerchant-shop-bot
24-
docker-compose up
25-
```

Diff for: docs/getting-started.md

+57-18
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ You do not need any computer skills, smarts, or anything of that nature. You are
55
## Prerequisites
66

77
- [git](https://git-scm.com/)
8-
- Either [Node.js 14](https://nodejs.org/en/) or [Docker](https://docs.docker.com/get-docker/) (advanced users)
8+
- Either [Node.js 14](https://nodejs.org/en/) or [Docker (1.13.0+)](https://docs.docker.com/get-docker/) (advanced users)
99

1010
## Using Node.js
1111

@@ -14,14 +14,14 @@ You do not need any computer skills, smarts, or anything of that nature. You are
1414
| tag | Example, `v1.0.0`; stable |
1515
| `main` | Latest HEAD; not tagged, could be unstable |
1616

17-
- [Node.js 14](https://nodejs.org/en/)
18-
- Clone this project `git clone https://github.com/jef/streetmerchant.git`.
19-
- To checkout a particular reference, use `git checkout <ref name>` after cloning.
20-
- Navigate to this project by entering `cd streetmerchant`.
21-
- Run `npm install`.
22-
- Make a copy of `dotenv-example` and name it `dotenv`.
23-
- Edit the `dotenv` file to your liking using a text editor (like [vscode](https://code.visualstudio.com/)).
24-
- Run `npm run start` to start.
17+
1. Download [Node.js 14](https://nodejs.org/en/)
18+
1. Clone this project `git clone https://github.com/jef/streetmerchant.git`.
19+
1. To checkout a particular reference, use `git checkout <ref name>` after cloning.
20+
1. Navigate to this project by entering `cd streetmerchant`.
21+
1. Run `npm install`.
22+
1. Make a copy of `dotenv-example` and name it `dotenv`.
23+
1. Edit the `dotenv` file to your liking using a text editor (like [vscode](https://code.visualstudio.com/)).
24+
1. Run `npm run start` to start.
2525

2626
At any point you want the program to stop, use ++ctrl+c++.
2727

@@ -39,28 +39,67 @@ Available via GitHub Container Registry.
3939

4040
```sh
4141
# to run docker nightly
42-
docker run --cap-add=SYS_ADMIN \
43-
-it --rm --env-file ./dotenv \
42+
docker run -it --rm \
43+
--env-file ./dotenv \
4444
ghcr.io/jef/streetmerchant:nightly
4545

4646
# to test notifications
47-
docker run --cap-add=SYS_ADMIN \
48-
-it --rm --env-file ./dotenv \
47+
docker run -it --rm \
48+
--env-file ./dotenv \
4949
ghcr.io/jef/streetmerchant:nightly test:notification:production
5050
```
5151

52+
See [Developing in docker](#developing-in-docker) for more information
53+
5254
## Customization
5355

5456
To customize streetmerchant, make a copy of `dotenv-example` as `dotenv` and make any changes to your liking. View [Reference](reference/application.md) for more information on variables and their usage.
5557

56-
57-
## Building docker
58-
59-
[Docker-Docs](docs/docker.md)
60-
6158
???+ tip
6259
All environment variables are optional.
6360

6461
## For developers
6562

63+
### Developing in Node.js
64+
6665
The command `npm run start:dev` can be used instead of `npm run start` to automatically restart the project when filesystem changes are detected in the `src/` folder or `dotenv` file.
66+
67+
Use `npm run lint` to see any linting uses and `npm run lint:fix` to automatically fix the issues it can.
68+
69+
### Developing in Docker
70+
71+
#### Prerequisites
72+
73+
- [Docker (1.13.0+)](https://docs.docker.com/get-docker/)
74+
- [GNU Make](https://www.gnu.org/software/make/)
75+
- Optional, but increases quality of life
76+
- [Docker Compose](https://docs.docker.com/compose/install/)
77+
- Depending on your system, you may already have this. Check before installing.
78+
79+
#### How
80+
81+
1. Make a copy of `dotenv-example` and name it `dotenv`.
82+
1. Edit the `dotenv` file to your liking using a text editor (like [vscode](https://code.visualstudio.com/)).
83+
1. If you're using `make`, you can run `make run` to start and `make stop` to stop.
84+
1. There are more options in the `Makefile`, feel free to explore.
85+
1. If you do not have `make`, you can run `docker-compose` directly:
86+
87+
```shell
88+
# To start
89+
# Use `-d` if you want to run in detached mode
90+
# Use `--build` if you want to build the image before running (default image is latest in GitHub Container Registry).
91+
docker-compose up
92+
93+
# To break down
94+
docker-compose down
95+
```
96+
97+
???+ note
98+
If you are using `WEB_PORT`, then you will need to add the following to docker-compose:
99+
100+
```
101+
ports:
102+
- "<WEB_PORT>:<WEB_PORT>"
103+
```
104+
105+
Replace `<WEB_PORT>` with the value you gave in your `dotenv`.

0 commit comments

Comments
 (0)