docker-compose dev env

This commit is contained in:
BuckarooBanzay 2020-10-05 08:10:04 +02:00
parent e976c27c2e
commit c1fa61acaf
11 changed files with 73 additions and 27 deletions

24
Dockerfile Normal file
View File

@ -0,0 +1,24 @@
# Stage 1 testing
FROM node:14.7.0-alpine as builder
COPY . /data
# build
RUN cd /data &&\
npm ci &&\
npm test &&\
npm run jshint_backend
# Stage 2 package
FROM node:14.7.0-alpine
COPY . /data
RUN cd /data && npm ci --only=production
COPY --from=builder /data/public /data/public
WORKDIR /data
EXPOSE 8080
CMD ["npm", "start"]

4
dev/data/minetest/world/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
env_meta.txt
force_loaded.txt
ipban.txt
map_meta.txt

View File

@ -0,0 +1,10 @@
gameid = minetest
creative_mode = false
enable_damage = true
pgsql_connection = host=postgres port=5432 user=postgres password=enter dbname=postgres
pgsql_player_connection = host=postgres port=5432 user=postgres password=enter dbname=postgres
auth_backend = sqlite3
player_backend = postgresql
backend = postgresql

34
dev/docker-compose.yml Normal file
View File

@ -0,0 +1,34 @@
version: "2.1"
services:
minetest:
image: buckaroobanzay/minetest:5.3.0-r5
ports:
- "30000:30000/udp"
depends_on:
- "postgres"
volumes:
- "./data/minetest:/data"
# - "./data/minetest/debug.txt:/root/.minetest/debug.txt"
working_dir: /data
command: minetestserver --config /data/minetest.conf --world /data/world/ --quiet
postgres:
image: postgres:12.4
environment:
POSTGRES_PASSWORD: enter
volumes:
- "postgres-data:/var/lib/postgresql/data"
mapcleaner:
build: ..
environment:
PGHOST: postgres
PGUSER: postgres
PGDATABASE: postgres
PGPASSWORD: enter
PGPORT: 5432
restart: "no"
volumes:
postgres-data: {}

View File

@ -1,9 +0,0 @@
#!/bin/sh
docker run --rm -it \
-u root:root \
-v $(pwd)/minetest.conf:/data/minetest.conf \
-v $(pwd)/world.mt:/data/world/world.mt \
-v $(pwd)/worldmods:/data/world/worldmods \
--network host \
buckaroobanzay/minetest:5.2.0-r1

View File

@ -1,7 +0,0 @@
#!/bin/sh
# setup
docker run --name mapcleaner_db --rm \
-e POSTGRES_PASSWORD=enter \
-p 5432:5432 \
postgres

View File

@ -1,2 +1,2 @@
#!/bin/sh
docker exec -it mapcleaner_db psql -U postgres
docker-compose exec postgres psql -U postgres

View File

@ -1,10 +0,0 @@
gameid = minetest
creative_mode = false
enable_damage = true
pgsql_connection = host=127.0.0.1 port=5432 user=postgres password=enter dbname=postgres
pgsql_player_connection = host=127.0.0.1 port=5432 user=postgres password=enter dbname=postgres
auth_backend = sqlite3
player_backend = postgresql
backend = postgresql