Compare commits
2 Commits
b9b1111307
...
cb8be12b63
Author | SHA1 | Date | |
---|---|---|---|
cb8be12b63 | |||
776019182d |
@ -4,8 +4,10 @@ COPY package*.json ./
|
|||||||
RUN npm i
|
RUN npm i
|
||||||
COPY . .
|
COPY . .
|
||||||
ENV PUBLIC_PB_URL=http://pb:8080
|
ENV PUBLIC_PB_URL=http://pb:8080
|
||||||
|
ENV PUBLIC_URL=http://localhost:4321
|
||||||
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
EXPOSE 4321
|
EXPOSE 4321
|
||||||
CMD ["npm", "run", "preview", "--", "--host"]
|
CMD ["npm", "run", "dev", "--", "--host"]
|
||||||
|
# CMD [ "node", "dist/sever/entry.mjs"]
|
||||||
|
@ -21,6 +21,8 @@ export default defineConfig({
|
|||||||
plugins: [tailwindcss()],
|
plugins: [tailwindcss()],
|
||||||
server: {
|
server: {
|
||||||
proxy: {
|
proxy: {
|
||||||
|
// The idea is to proxy the Pocketbase connection to the current domain so the user doesn't have to open two ports
|
||||||
|
// Currently works in dev (npm run dev -- --host) with the correct PUBLIC_URL var set but not through docker
|
||||||
'/api': {
|
'/api': {
|
||||||
target: PUBLIC_PB_URL,
|
target: PUBLIC_PB_URL,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
|
@ -2,6 +2,7 @@ services:
|
|||||||
web:
|
web:
|
||||||
build: .
|
build: .
|
||||||
env_file: .env
|
env_file: .env
|
||||||
|
network_mode: host
|
||||||
ports:
|
ports:
|
||||||
- "4321:4321"
|
- "4321:4321"
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "astro dev",
|
"dev": "docker compose up pb -d; astro dev --host",
|
||||||
"build": "astro build",
|
"build": "astro build",
|
||||||
"preview": "astro preview",
|
"preview": "astro preview",
|
||||||
"astro": "astro"
|
"astro": "astro"
|
||||||
|
@ -2,4 +2,3 @@ import Pocketbase from "pocketbase"
|
|||||||
|
|
||||||
const client = new Pocketbase(import.meta.env.PUBLIC_URL)
|
const client = new Pocketbase(import.meta.env.PUBLIC_URL)
|
||||||
export default client;
|
export default client;
|
||||||
// export const client = new Pocketbase("http://localhost:8080")
|
|
@ -7,12 +7,12 @@ const recipies = await client.collection("recipes").getFullList()
|
|||||||
---
|
---
|
||||||
|
|
||||||
<PageLayout>
|
<PageLayout>
|
||||||
<p class="w-full bg-yellow-100 p-5 text-3xl pb-4 font-medium">Recipie</p>
|
<p class="w-full bg-yellow-100 p-5 text-3xl font-medium">Recipie</p>
|
||||||
|
|
||||||
<div id="content" class="p-5">
|
<div id="content" class="p-5 pt-2">
|
||||||
<p class="pb-2">What would you like today?</p>
|
<p class="pb-2">What would you like today?</p>
|
||||||
|
|
||||||
<div class="grid gap-2 grid-cols-1 md:grid-cols-2 lg:grid-cols-3">
|
<div class="grid gap-2 grid-cols-1 md:grid-cols-2 lg:grid-cols-4">
|
||||||
{
|
{
|
||||||
recipies.map(r => (
|
recipies.map(r => (
|
||||||
<OverviewCard recipe={r} />
|
<OverviewCard recipe={r} />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user