Skip to content

Commit

Permalink
fix: small tweak of logo + Docker setup
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseKoldewijn committed Aug 25, 2023
1 parent 246f4e6 commit 90b578c
Show file tree
Hide file tree
Showing 8 changed files with 227 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store
node_modules
dist
.vercel
.git
52 changes: 52 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
FROM node:18-slim AS base

WORKDIR /app

# By copying only the package.json and pnpm-lock.yaml files
COPY package.json pnpm-lock.yaml ./

# Copying the `.npmrc` file
COPY .npmrc ./

# Copying the other config files
COPY ./tsconfig.json ./
COPY ./prettier.config.cjs ./
COPY ./seo-config.ts ./

# Installing pnpm
RUN npm install -g pnpm

FROM base AS prod-deps

RUN pnpm install --production

FROM base AS build-deps

RUN pnpm install --production=false

FROM build-deps AS build

ARG PORT=3000
ENV PORT=$PORT
ENV HOST=0.0.0.0
ENV CONTAINER=true

COPY . .

RUN pnpm run build

RUN pnpm prune --prod

FROM base AS runtime

ARG PORT=3000
ENV PORT=$PORT
ENV HOST=0.0.0.0

COPY --from=prod-deps /app/node_modules ./node_modules

COPY --from=build /app/dist ./dist

EXPOSE $PORT:$PORT

CMD node ./dist/server/entry.mjs
9 changes: 8 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import node from "@astrojs/node";
import prefetch from "@astrojs/prefetch";
import react from "@astrojs/react";
import sitemap from "@astrojs/sitemap";
Expand All @@ -9,10 +10,16 @@ import { defineConfig } from "astro/config";

import { manifest, seoConfig } from "./seo-config";

const isDocker = process.env.CONTAINER === "true";

// https://astro.build/config
export default defineConfig({
output: "server",
adapter: vercel(),
adapter: !isDocker
? vercel()
: node({
mode: "standalone",
}),
site: seoConfig.baseURL,
compressHTML: true,
integrations: [
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/node": "^5.3.6",
"@astrojs/prefetch": "^0.3.0",
"@astrojs/react": "^2.3.2",
"@astrojs/sitemap": "^2.0.2",
"@astrojs/ts-plugin": "^1.1.1",
"@astrojs/vercel": "^3.8.2",
"@glitchtech-dev/react-motion": "^1.5.1",
"@heroicons/react": "^2.0.18",
"astro": "^2.10.13",
"jquery": "^3.7.0",
"motion": "^10.16.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.10.1"
"react-dom": "^18.2.0"
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
Expand Down
Loading

0 comments on commit 90b578c

Please sign in to comment.