Skip to content

Commit ec0df6f

Browse files
authored
v0.1.0 release (#1)
* first push to dev * fix typo in Dockerfile: missing run for apk * fix docker CMD * npm install missing modules * npm install fix * fix npm install (2) * Update docker_dev.yml * Update docker.yml * Update README.md * Update Dockerfile description of package
1 parent 51c43f0 commit ec0df6f

File tree

9 files changed

+486
-2
lines changed

9 files changed

+486
-2
lines changed

.dockerignore

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#Ignore the git and cache folders
2+
.git
3+
.gitignore
4+
5+
# Docker build spec
6+
Dockerfile
7+
8+
# Git repository metadata
9+
.git
10+
**/.gitignore
11+
.cache
12+
.drone.yml
13+
.github
14+
15+
# Object code
16+
**/*.o
17+
**/*.so
18+
**/*.lo
19+
**/*.la
20+
21+
# gcov files
22+
**/*.gcda
23+
**/*.gcov
24+
**/*.gcno
25+
26+
# Backup files
27+
**/*~
28+
29+
# Release files
30+
**/*.tar.gz
31+
32+
# Files currently being edited by vim or vi
33+
**/*.swp
34+
35+
# automake/autoconf
36+
**/.deps/
37+
**/.dirstamp
38+
**/.libs/
39+
**/Makefile
40+
**/Makefile.in
41+
aclocal.m4
42+
autom4te.cache/
43+
m4/*
44+
**/!README
45+
compile
46+
config.guess
47+
config.h
48+
config.h.in
49+
config.log
50+
config.status
51+
config.sub
52+
configure
53+
depcomp
54+
install-sh
55+
libtool
56+
ltmain.sh
57+
missing
58+
stamp-h1
59+
test-driver
60+
61+
# Test binaries
62+
tests/test_*
63+
!tests/test_*.[ch]
64+
65+
#Ingore all markdown and class files
66+
*.md
67+
**/*.class

.github/dependabot.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions" # See documentation for possible values
4+
directory: "/" # Location of package manifests
5+
schedule:
6+
interval: "weekly"
7+
target-branch: "dev"
8+
# Add reviewers
9+
reviewers:
10+
- "MaxWaldorf"
11+
12+
- package-ecosystem: "docker" # See documentation for possible values
13+
directory: "/" # Location of package manifests
14+
schedule:
15+
interval: "weekly"
16+
target-branch: "dev"
17+
reviewers:
18+
- "MaxWaldorf"
19+
20+
- package-ecosystem: "npm" # See documentation for possible values
21+
directory: "/" # Location of package manifests
22+
schedule:
23+
interval: "weekly"
24+
target-branch: "dev"
25+
reviewers:
26+
- "MaxWaldorf"

.github/workflows/docker.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Build Main Docker Image
2+
3+
# Controls when the workflow will run
4+
on:
5+
push:
6+
branches:
7+
- 'main'
8+
- 'v*.x'
9+
tags:
10+
- 'v*'
11+
workflow_dispatch:
12+
13+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
jobs:
19+
release:
20+
runs-on: ubuntu-latest
21+
steps:
22+
23+
- uses: actions/checkout@v3
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Set up QEMU
28+
uses: docker/setup-qemu-action@v2
29+
30+
- name: Set up Docker Buildx
31+
uses: docker/setup-buildx-action@v2
32+
33+
- name: Login to GitHub Container Registry
34+
uses: docker/login-action@v2
35+
with:
36+
registry: ghcr.io
37+
username: ${{ github.repository_owner }}
38+
password: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- name: Docker meta
41+
id: meta
42+
uses: docker/metadata-action@v4
43+
with:
44+
images: ghcr.io/${{ github.repository }}
45+
tags: |
46+
type=semver,pattern={{version}}
47+
type=semver,pattern={{major}}.{{minor}}
48+
type=semver,pattern={{major}}.x
49+
type=raw,value=latest,enable={{is_default_branch}}
50+
type=ref,event=branch,enable=${{ github.event.repository.default_branch != github.ref }}
51+
52+
- name: Build and push Docker images
53+
uses: docker/build-push-action@v4
54+
with:
55+
context: .
56+
file: ./Dockerfile
57+
push: true
58+
tags: ${{ steps.meta.outputs.tags }}
59+
platforms: linux/amd64,linux/arm64,linux/ppc64le
60+
cache-from: type=gha
61+
cache-to: type=gha,mode=max

.github/workflows/docker_dev.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Build Dev Docker Image
2+
3+
# Controls when the workflow will run
4+
on:
5+
schedule:
6+
- cron: '0 0 * * *'
7+
push:
8+
branches: [ dev ]
9+
pull_request:
10+
branches: [ dev ]
11+
workflow_dispatch:
12+
13+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
jobs:
19+
release:
20+
runs-on: ubuntu-latest
21+
steps:
22+
23+
- uses: actions/checkout@v3
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Set up QEMU
28+
uses: docker/setup-qemu-action@v2
29+
30+
- name: Set up Docker Buildx
31+
uses: docker/setup-buildx-action@v2
32+
33+
- name: Login to GitHub Container Registry
34+
uses: docker/login-action@v2
35+
with:
36+
registry: ghcr.io
37+
username: ${{ github.repository_owner }}
38+
password: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- name: Docker meta
41+
id: meta
42+
uses: docker/metadata-action@v4
43+
with:
44+
images: ghcr.io/${{ github.repository }}
45+
tags: |
46+
type=schedule,pattern=testing
47+
type=raw,value=testing
48+
flavor: |
49+
latest=false
50+
51+
- name: Build and push Docker images
52+
uses: docker/build-push-action@v4
53+
with:
54+
context: .
55+
file: ./Dockerfile
56+
push: true
57+
tags: ${{ steps.meta.outputs.tags }}
58+
platforms: linux/amd64,linux/arm64,linux/ppc64le
59+
cache-from: type=gha
60+
cache-to: type=gha,mode=max

Dockerfile

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Define base container
2+
ARG NODE_VER="20"
3+
FROM node:${NODE_VER}-alpine
4+
5+
# Arguments for labels creation
6+
ARG APPLICATION="bms-maps-server"
7+
ARG BUILD_RFC3339="2023-06-30T13:00:00Z"
8+
ARG REVISION="local"
9+
ARG DESCRIPTION="A collaboration server to enable mission preparation for multiplayer missions inside Falcon BMS maps website"
10+
ARG PACKAGE="BenchmarkSims/maps-server"
11+
ARG VERSION="0.1.0"
12+
13+
# Define where application will run
14+
ARG APP_DIR=/opt/node
15+
WORKDIR ${APP_DIR}
16+
17+
# Environment variables passed through container run
18+
ENV \
19+
MAPS_SERVER_PORT="3000"
20+
21+
# Labels creation for container
22+
LABEL org.opencontainers.image.ref.name="${PACKAGE}" \
23+
org.opencontainers.image.created=$BUILD_RFC3339 \
24+
org.opencontainers.image.authors="MaxWaldorf" \
25+
org.opencontainers.image.documentation="https://github.com/${PACKAGE}/README.md" \
26+
org.opencontainers.image.description="${DESCRIPTION}" \
27+
org.opencontainers.image.licenses="GPLv3" \
28+
org.opencontainers.image.source="https://github.com/${PACKAGE}" \
29+
org.opencontainers.image.revision=$REVISION \
30+
org.opencontainers.image.version=$VERSION \
31+
org.opencontainers.image.url="https://ghcr.io/${PACKAGE}"
32+
33+
# Make sure curl is installed
34+
RUN apk add --no-cache curl
35+
36+
# Create directory
37+
RUN mkdir -p ${APP_DIR}
38+
39+
# Copy application content and proper rights
40+
COPY source ${APP_DIR}
41+
RUN chown -R node:node ${APP_DIR}
42+
43+
# Install missing modules
44+
RUN /usr/local/bin/npm install
45+
46+
# Declare application directory into environment variables
47+
ENV APP_DIR ${APP_DIR}
48+
49+
# Declare container run options
50+
SHELL ["/bin/sh", "-c"]
51+
52+
STOPSIGNAL SIGINT
53+
54+
ENV NODE_DEBUG="net,http,module"
55+
56+
HEALTHCHECK CMD curl -f http://localhost:${MAPS_SERVER_PORT} || false
57+
58+
CMD node ${APP_DIR}/index.js ${MAPS_SERVER_PORT}
59+
60+
EXPOSE ${MAPS_SERVER_PORT}

README.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,38 @@
1-
# maps-server
2-
A collaboration server to enable mission preparation for multiplayer missions
1+
[![Build Docker Image](https://github.com/BenchmarkSims/maps-server/actions/workflows/docker.yml/badge.svg)](https://github.com/BenchmarkSims/maps-server/actions/workflows/docker.yml)
2+
3+
[![Build Dev Docker Image](https://github.com/BenchmarkSims/maps-server/actions/workflows/docker_dev.yml/badge.svg)](https://github.com/BenchmarkSims/maps-server/actions/workflows/docker_dev.yml)
4+
5+
# Falcon BMS Collaboration Server (maps website)
6+
A collaboration server to enable mission preparation for multiplayer missions inside Falcon BMS maps website
7+
8+
## How to use it
9+
10+
### Regular install
11+
Instructions:
12+
- Install node executable on your machine
13+
- Download the files from the latest release /source folder
14+
- Put the content into the folder you wish to run the application
15+
- Run the following lines to run the server:
16+
```
17+
cd my_application _folder
18+
npm install
19+
node my_application_folder/index.js PORT
20+
```
21+
22+
The `PORT` parameter will default to 3000 but you can change it to whatever you need...
23+
24+
### Container
25+
- Supported Linux OS: amd64, arm64, ppc64le
26+
27+
- ENV variables:
28+
- MAPS_SERVER_PORT (Default: 3000)
29+
30+
- Image run:
31+
`docker pull ghcr.io/benchmarksims/maps-server:latest`
32+
(other interesting tags: testing)
33+
34+
35+
## License
36+
The project presented here is under GNU GPL v3.
37+
38+
We encourage people to contribute to this project instead of creating a fork...

0 commit comments

Comments
 (0)