diff --git a/.gitattributes b/.gitattributes index 26fc6d9..80b580d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,3 @@ /resources/i18n/*.ftl linguist-language=INI + +/docker/.vimrc text eol=lf diff --git a/.gitignore b/.gitignore index 2aaec84..e702e84 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ *.iml *.ipr *.iws +/docker/.ssh/ diff --git a/docker/.vimrc b/docker/.vimrc new file mode 100644 index 0000000..5757e01 --- /dev/null +++ b/docker/.vimrc @@ -0,0 +1,2 @@ +set bg=dark +syn on diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..b45b307 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,14 @@ +FROM node:8-buster + +COPY .vimrc /root +COPY .ssh /root/.ssh/ + +RUN apt-get update && \ + apt-get install -y vim man && \ + chmod 644 /root/.vimrc && \ + echo 'alias ll="ls -lF --color=auto"' >> /root/.bashrc && \ + chmod 700 /root/.ssh && \ + chmod 644 /root/.ssh/* && \ + chmod 600 /root/.ssh/id_ed25519 + +WORKDIR /build diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..7e591ff --- /dev/null +++ b/docker/README.md @@ -0,0 +1,17 @@ +# docker + +This folder contains some supplementary files for setting up a Docker environment on the local machine for building +CivBuddy. It is not part of the CivBuddy app. + +Prerequisites: + +1. [Add SSH keys to GitHub](https://docs.github.com/en/authentication/connecting-to-github-with-ssh) +2. Provide them in /docker/.ssh/ so that they can be included with the container + +In this folder: + +- `docker build -t civbuddy-node:8 --progress plain .` +- `docker run --rm -it -vC:\path\to\civbuddy:/build --entrypoint=/bin/bash civbuddy-node:8` +- `cd /build` +- `npm install` +- `npm run build` (or whatever other command)