diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +node_modules/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8b5aabd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM node:12.22.1 as build + +WORKDIR /app/build + +COPY . /app/build + +RUN yarn \ + && npx quasar build + +FROM nginx as nginx-branle + +COPY ./nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf + +COPY --from=build /app/build/dist/spa /app diff --git a/README.md b/README.md index 49d1789..81a4d81 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,18 @@ yarn run lint quasar build ``` +## Docker + +### Build the docker image +```bash +docker build -t branle . +``` + +### Run the container +```bash +docker run -d -p 8080:80 --name branle branle +``` + ### Customize the brand Edit `customize.json` and replace the colors, icon, name and dark mode setting. When setting the dark mode, you can also set the colors `"dark-page"` and `"dark"`. diff --git a/nginx/conf.d/default.conf b/nginx/conf.d/default.conf new file mode 100644 index 0000000..4995957 --- /dev/null +++ b/nginx/conf.d/default.conf @@ -0,0 +1,9 @@ +server { + listen 80; + root /app; + + location / { + index index.html; + try_files $uri $uri/ /index.html; + } +}