diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..ab223e4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules/ +.astro/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5263055 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM node:21-alpine + +WORKDIR /app + +RUN mkdir -p /var/sqlite + +COPY package.json . + +RUN npm install + +COPY . . + +RUN npm run migrate +RUN npm run build + +EXPOSE 8000 + +CMD ["dist/server/entry.mjs"] diff --git a/astro.config.mjs b/astro.config.mjs index f8157b9..ea54522 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -8,6 +8,9 @@ export default defineConfig({ output: "hybrid", integrations: [tailwind()], adapter: node({ - mode: "standalone" - }) -}); \ No newline at end of file + mode: "standalone", + }), + server: { + port: 8000, + }, +}); diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..7be32fc --- /dev/null +++ b/compose.yaml @@ -0,0 +1,11 @@ +services: + frontend: + build: . + ports: + - "8000:8000" + environment: + DATABASE_PATH: /var/sqlite/reset-sender-v2.sqlite + volumes: + - sqlite_data:/var/sqlite +volumes: + sqlite_data: diff --git a/package.json b/package.json index 5cd8796..ca3483d 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "scripts": { "dev": "astro dev", "start": "astro dev", - "build": "astro check && astro build", + "check": "astro check --root src", + "build": "astro build", "preview": "astro preview", "astro": "astro", "migrate": "node ./scripts/migrate.js"