-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Lualttt/master
added dockerfile and instructions
- Loading branch information
Showing
3 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
**/.classpath | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitattributes | ||
**/.gitignore | ||
**/.github | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/.next | ||
**/.cache | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/charts | ||
**/docker-compose* | ||
**/compose.y*ml | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
**/build | ||
**/dist | ||
LICENSE | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
ARG NODE_VERSION=18.0.0 | ||
|
||
FROM node:${NODE_VERSION} | ||
|
||
WORKDIR /usr/src/app | ||
|
||
RUN --mount=type=bind,source=package.json,target=package.json \ | ||
--mount=type=bind,source=package-lock.json,target=package-lock.json \ | ||
--mount=type=cache,target=/root/.npm \ | ||
npm ci | ||
|
||
COPY . . | ||
|
||
EXPOSE 8000 | ||
CMD npm run start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Pipe-Bomb-Server | ||
### Docker instructions | ||
Before we run the server you will have to build the pipe bomb docker image by doing; | ||
``` | ||
$ docker build -t "pipe-bomb-server" . | ||
``` | ||
After the image is built you want to find a place to put the container in, personally I will do it in `~/docker/pipe-bomb-server`. In the directory of your choosing make a `compose.yml` file which should look something like this. | ||
```yaml | ||
services: | ||
pipe-bomb-server: | ||
image: pipe-bomb-server | ||
container_name: pipe-bomb-server | ||
ports: | ||
- "8000:8000" | ||
# volumes: | ||
# - ./Config.json:/usr/src/app/Config.json | ||
# # the database has a volume incase you want to move/backup or do anything else with the files | ||
# - ./database/music.db:/usr/src/app/music.db | ||
# - ./database/music.db-smh:/usr/src/app/music.db-shm | ||
# - ./database/music.db-wal:/usr/src/app/music.db-wal | ||
restart: unless-stopped | ||
``` | ||
Keep the volumes commented out at first so we can let pipe bomb generate the files needed for the volumes, to let pipe bomb generate them run the following command. | ||
``` | ||
$ docker compose up | ||
``` | ||
When you see something like the line `API is listening on ___` it's done staring up and generating the files, you can now safely do `CTRL-c` to stop the server. Now we can uncomment the volumes but before we can run it again we must copy the generated files over. | ||
``` | ||
$ docker cp pipe-bomb-server:/usr/src/app/Config.json . | ||
$ mkdir database | ||
$ docker cp pipe-bomb-server:/usr/src/app/music.db ./database/music.db | ||
$ docker cp pipe-bomb-server:/usr/src/app/music.db-shm ./database/music.db-shm | ||
$ docker cp pipe-bomb-server:/usr/src/app/music.db-wal ./database/music.db-wal | ||
``` | ||
Feel free to edit the config as you like and once you are done with that you can run the server by doing this command (-d will run it in the background) | ||
``` | ||
$ docker compose up | ||
``` |