Skip to content

Commit

Permalink
fix docker errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiaz9 committed Nov 5, 2024
1 parent 25e11f5 commit 7074868
Show file tree
Hide file tree
Showing 6 changed files with 1,390 additions and 2,142 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ COPY --from=build ./usr/src/app/apps/cms/extensions ./extensions
COPY --from=build ./usr/src/app/apps/cms/migrations ./migrations
RUN mkdir -p uploads
RUN chown -R node:node uploads
CMD node cli.js bootstrap && node cli.js database migrate:latest && node cli.js schema apply --yes ./snapshot.yaml && node cli.js start
CMD node cli.js bootstrap && node cli.js database migrate:latest && node cli.js start
16 changes: 7 additions & 9 deletions apps/cms/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cms",
"version": "1.2.0",
"version": "1.2.1",
"license": "Apache-2.0",
"scripts": {
"dev": "concurrently \"pnpm:watch\" \"pnpm:start\"",
Expand All @@ -18,25 +18,24 @@
},
"dependencies": {
"@directus/constants": "12.0.0",
"@directus/sdk": "17.0.1",
"@directus/types": "12.0.1",
"@mailchimp/mailchimp_marketing": "3.0.80",
"@directus/sdk": "18.0.0",
"@directus/types": "12.2.0",
"@octokit/rest": "21.0.2",
"@sendgrid/mail": "8.1.3",
"axios": "1.7.7",
"directus": "11.1.0",
"directus": "11.1.2",
"dotenv": "16.4.5",
"knex": "3.1.0",
"pg": "8.12.0",
"pg": "8.13.1",
"remark-parse": "11.0.0",
"remark-slate": "1.8.6",
"slate-blocks": "workspace:*",
"unified": "11.0.5",
"vue-i18n": "9.14.0"
},
"devDependencies": {
"@directus/extensions": "2.0.1",
"@directus/extensions-sdk": "12.0.2",
"@directus/extensions": "2.0.3",
"@directus/extensions-sdk": "12.1.1",
"@rollup/plugin-alias": "5.1.0",
"@rollup/plugin-commonjs": "26.0.1",
"@rollup/plugin-json": "6.1.0",
Expand All @@ -46,7 +45,6 @@
"@rollup/plugin-typescript": "11.1.6",
"@rollup/plugin-url": "8.0.2",
"@types/express": "4.17.21",
"@types/mailchimp__mailchimp_marketing": "3.0.20",
"@vitejs/plugin-vue": "5.1.3",
"@vue/compiler-sfc": "3.5.2",
"concurrently": "8.2.2",
Expand Down
4 changes: 1 addition & 3 deletions apps/cms/scripts/entries.extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ export function getExtensionsEntries() {
format,
exports,
},
external: isApiExtension
? [...API_SHARED_DEPS, "@mailchimp/mailchimp_marketing"]
: APP_SHARED_DEPS,
external: isApiExtension ? API_SHARED_DEPS : APP_SHARED_DEPS,
plugins: isApiExtension ? API_PLUGINS : APP_PLUGINS,
logLevel: "warn",
onwarn: (warning, warn) => {
Expand Down
3 changes: 2 additions & 1 deletion apps/cms/src/deploys/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { defineEndpoint } from "@directus/extensions"
import { Octokit } from "@octokit/rest"
import { config } from "dotenv"

require("dotenv").config()
config()

export default defineEndpoint({
id: "deploys",
Expand Down
11 changes: 3 additions & 8 deletions apps/cms/src/subscribe/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import { defineEndpoint } from "@directus/extensions"
import mailchimp from "@mailchimp/mailchimp_marketing"
import axios, { isAxiosError } from "axios"
import { config } from "dotenv"

require("dotenv").config()
config()

export default defineEndpoint({
id: "subscribe",
handler(router, context) {
router.post("/:list", async (req, res) => {
try {
mailchimp.setConfig({
apiKey: process.env.MAILCHIMP_TOKEN,
server: process.env.MAILCHIMP_SERVER,
})

const submission = req.body as {
email: string
fname: string
Expand All @@ -36,7 +31,7 @@ export default defineEndpoint({
FNAME: submission.fname,
LNAME: submission.lname ?? "",
},
} satisfies mailchimp.lists.AddListMemberBody
}

const url = `https://${process.env.MAILCHIMP_SERVER}.api.mailchimp.com/3.0/lists/${listId}/members`
const resp = await axios.post(
Expand Down
Loading

0 comments on commit 7074868

Please sign in to comment.