Skip to content

Commit

Permalink
Merge pull request #98 from MinBZK/fix/env-vars
Browse files Browse the repository at this point in the history
fix: image env vars
  • Loading branch information
onursagir authored Dec 12, 2022
2 parents 69a9c73 + fd27e2d commit 3a59b64
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 4 additions & 0 deletions apps/web/dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store\

ADD . .

ENV CMS_API=http://cms:9001/api

ENV NEXT_PUBLIC_CMS_ROOT_URL=http://cms.localhost/

CMD pnpm dev:web
11 changes: 6 additions & 5 deletions apps/web/src/pages/methoden.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@ const Methoden: React.FC<Props> = ({ methods }) => {
<Stack spacing={2}>
<Typography variant="h3">Methoden</Typography>
<Box display="grid" gridTemplateColumns="repeat(3, 1fr)" columnGap={4} alignItems="flex-start">
{methods.data.map((method) => {
{methods.data?.map((method) => {
const mediaURL = new URL(
`/cms${method.attributes.Visual?.data.attributes.formats.medium.url}`,
process.env.NEXT_PUBLIC_CMS_API
`${method.attributes.Visual?.data.attributes.formats.medium.url}`,
process.env.NEXT_PUBLIC_CMS_ROOT_URL
);

return (
<Card key={method.id}>
{/* <CardMedia
<CardMedia
component="img"
height="300"
image={mediaURL.toString()}
alt={method.attributes.Visual?.data.attributes.formats.medium.name}
/> */}
/>
<CardContent>
<Typography gutterBottom variant="h5" component="div">
{method.attributes.Title}
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ services:
- .env
web:
restart: always
environment:
- CMS_API=http://cms:9001/api
build:
context: .
dockerfile: apps/web/dockerfile.prod
Expand Down

0 comments on commit 3a59b64

Please sign in to comment.