Skip to content

Commit

Permalink
feat: login (#46)
Browse files Browse the repository at this point in the history
* feat: login

* feat(docker): .dockerignore
  • Loading branch information
shalluv authored Jan 7, 2024
1 parent 47a900c commit d264312
Show file tree
Hide file tree
Showing 8 changed files with 168 additions and 24 deletions.
24 changes: 24 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# build output
dist/
# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store

# vscode
.vscode/
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
FROM ghcr.io/isd-sgcu/astro-dyn-config:v0.0.2

FROM node:lts AS runtime
WORKDIR /app

COPY public package*.json astro.config.mjs tailwind.config.mjs tsconfig.json ./
COPY . .

RUN npm i
RUN npm install
RUN npm run build

COPY src ./src
ENV HOST=0.0.0.0
ENV PORT=8080
EXPOSE 8080
CMD node ./dist/server/entry.mjs
7 changes: 6 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ import react from "@astrojs/react";
import tailwind from "@astrojs/tailwind";
import { defineConfig } from "astro/config";

import node from "@astrojs/node";

// https://astro.build/config
export default defineConfig({
output: "hybrid",
integrations: [tailwind(), react()],
output: "static",
adapter: node({
mode: "standalone",
}),
});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
},
"dependencies": {
"@astrojs/check": "^0.3.4",
"@astrojs/node": "^7.0.4",
"@astrojs/react": "^3.0.9",
"@astrojs/tailwind": "^5.1.0",
"@astrojs/ts-plugin": "1.3.1",
Expand Down
134 changes: 123 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components/Landing/SignInButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const SignInButton = () => {
const handleClick = () => {
console.log("Sign in with Google");
window.location.href = `${import.meta.env.PUBLIC_API_BASE_URL}/auth/login`;
};

return (
Expand Down
4 changes: 4 additions & 0 deletions src/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
interface ImportMetaEnv {
PUBLIC_API_BASE_URL: string;
}

interface ImportMeta {
readonly env: ImportMetaEnv;
}
Loading

0 comments on commit d264312

Please sign in to comment.