Skip to content

Commit

Permalink
moved dockerfiles out and updated readme (PrismarineJS#511)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBrenny authored Nov 7, 2021
1 parent abc399c commit 4c4e6e5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
3 changes: 2 additions & 1 deletion deploy/.dockerignore → .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
**/.env
**/.editorconfig
**/.aws
**/dist
**/dist
**/node_modules
4 changes: 2 additions & 2 deletions deploy/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM node:14-slim
FROM node:16-slim

WORKDIR /app
COPY package.json ./
RUN npm config set bin-links false
RUN npm install
RUN npm run prepare
COPY . .

ENTRYPOINT [ "node", "app.js", "-c", "/config" ]
2 changes: 1 addition & 1 deletion deploy/docker-compose.yaml → docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.8'

services:
flying-squid:
image: prismarinejs/flying-squid
build: .
volumes:
- ${PWD}/config:/config
ports:
Expand Down
33 changes: 24 additions & 9 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,34 @@ Create Minecraft servers with a powerful, stable, and high level JavaScript API.
## Building / Running
Before running or building it is recommended that you configure the server in `config/settings.json`

npm install
node app.js
```bash
npm install
node app.js
```

Or try our autoupdating flying-squid server [autonomous-squid](https://github.com/mhsjlw/autonomous-squid)

You can also install flying-squid globally with `sudo npm install -g flying-squid`
and then run it with `flying-squid` command.
You can also install flying-squid globally with `sudo npm install -g flying-squid` and then run it with `flying-squid` command.

### Docker

Docker allows a higer level of isolation, compatibily and consistency. You can learn how to install Docker [here](https://www.docker.com/get-started)
Docker allows a higer level of isolation, compatibily and consistency. You can learn how to install Docker [here](https://www.docker.com/get-started).

```bash
docker run prismarinejs/flying-squid
Quick start a simple server to test out flying-squid:

```bash
docker run -p 25565:25565 prismarinejs/flying-squid
```
With specific flying-squid configuration, container name and the most important, opening the port to flying-squid:

With specific configuration and a container name:

```bash
docker run -p 25565:25565 -v $(pwd)/config:/config --name my-flying-squid --rm prismarinejs/flying-squid
docker run -p 25565:25565 -v $(pwd)/config:/config --name my-flying-squid prismarinejs/flying-squid
```

[docker-compose](https://docs.docker.com/compose/) is useful to quickly launch & stop a single container with a specific configuration.

`docker-compose.yaml`:
```yaml
version: '3.8'

Expand All @@ -70,6 +74,17 @@ volumes:
docker-compose -f path/to/docker-compose.yaml up
```

Or do it all locally:
```bash
docker build -t local-flying-squid .
docker run -p 25565:25565 local-flying-squid
```

or

```bash
docker-compose up
```

## World generation

Expand Down

0 comments on commit 4c4e6e5

Please sign in to comment.