From d2728ce59ceb9647d47a36955a201188a1066d60 Mon Sep 17 00:00:00 2001 From: GCham5 Date: Tue, 11 Apr 2023 21:58:10 -0400 Subject: [PATCH] add docker --- .dockerignore | 11 +++++++++++ Dockerfile | 15 +++++++++++++++ docker-compose.yml | 6 ++++++ gatsby-config.js | 31 ++++++++++++++++++++++++------- package.json | 4 ++-- 5 files changed, 58 insertions(+), 9 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..aaf3829c6 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,11 @@ +.git +nodemodules +.eslint* +.prettier* +.git* +.vscode +README.md +Dockerfile* +docker-compose.yml +public +.cache \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..e81999528 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM node:19 + +WORKDIR /app + +COPY package*.json ./ + +RUN npm install + +COPY . . + +RUN npm run build + +EXPOSE 8000 + +CMD ["npm", "run", "develop"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..40c0ef038 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,6 @@ +version: '3' +services: + app: + build: . + ports: + - "8000:8000" diff --git a/gatsby-config.js b/gatsby-config.js index dfd5849d0..bd4f5e352 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -6,12 +6,29 @@ module.exports = { title: `SFL Website v2`, siteUrl: `https://www.yourdomain.tld` }, - plugins: ["gatsby-plugin-google-gtag", "gatsby-plugin-sitemap", "gatsby-plugin-mdx", { - resolve: 'gatsby-source-filesystem', - options: { - "name": "pages", - "path": "./src/pages/" + plugins: [ + { + resolve: `gatsby-plugin-google-gtag`, + options: { + trackingIds: [ + "UA-1111111111-1" // TODO: change to our own ID + ], + gtagConfig: { + anonymize_ip: true, + }, + pluginConfig: { + head: true, + }, + }, }, - __key: "pages" - }] + "gatsby-plugin-sitemap", + "gatsby-plugin-mdx", + { + resolve: 'gatsby-source-filesystem', + options: { + "name": "pages", + "path": "./src/pages/" + }, + __key: "pages" + }] }; \ No newline at end of file diff --git a/package.json b/package.json index c535a8deb..2de455cfa 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "gatsby" ], "scripts": { - "develop": "gatsby develop", + "develop": "gatsby develop -H 0.0.0.0", "start": "gatsby develop", "build": "gatsby build", "serve": "gatsby serve", @@ -29,4 +29,4 @@ "react": "^18.2.0" } } -} +} \ No newline at end of file