Skip to content

Commit

Permalink
frontend env vars at container run time
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabi-02 committed Jan 17, 2024
1 parent b836cf2 commit 770b221
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 17 deletions.
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ services:
frontend-default:
build:
context: ./frontend
args:
- VITE_TENANT=default
- VITE_TENANT_CLIENT_ID=e9fdb985-9173-4e01-9d73-ac2d60d1dc8e
ports:
- "5173:3000"
environment:
- VITE_TENANT=default
- VITE_TENANT_CLIENT_ID=e9fdb985-9173-4e01-9d73-ac2d60d1dc8e
frontend-adac:
build:
context: ./frontend
args:
- VITE_TENANT=adac
- VITE_TENANT_CLIENT_ID=74b35a42-b914-4b7e-abb5-c5184a3ca334
ports:
- "5174:3000"
environment:
- VITE_TENANT=adac
- VITE_TENANT_CLIENT_ID=74b35a42-b914-4b7e-abb5-c5184a3ca334
pin-service:
build: ./services/pin-service
ports:
Expand Down
16 changes: 9 additions & 7 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
FROM node:18-alpine

ARG VITE_TENANT
ARG VITE_TENANT_CLIENT_ID
# ARG VITE_TENANT
# ARG VITE_TENANT_CLIENT_ID

ENV VITE_TENANT=$VITE_TENANT
ENV VITE_TENANT_CLIENT_ID=$VITE_TENANT_CLIENT_ID
# ENV VITE_TENANT=$VITE_TENANT
# ENV VITE_TENANT_CLIENT_ID=$VITE_TENANT_CLIENT_ID

WORKDIR /app

COPY package*.json ./
RUN npm ci

COPY . .
RUN npm run build

RUN npm install serve

# RUN npm run build

EXPOSE 3000
ENTRYPOINT [ "npx", "serve", "-s" ,"dist" ]
# ENTRYPOINT [ "npx", "serve", "-s" ,"dist" ]

ENTRYPOINT [ "./entrypoint.sh" ]
3 changes: 3 additions & 0 deletions frontend/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
npm run build
npx serve -s dist
2 changes: 1 addition & 1 deletion frontend/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.0.1a2
v0.0.1a3
6 changes: 3 additions & 3 deletions fusionauth/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ services:
restart: unless-stopped
ports:
- 9011:9011
volumes:
- fusionauth_config:/usr/local/fusionauth/config
- ./kickstart:/usr/local/fusionauth/kickstart
# volumes:
# - fusionauth_config:/usr/local/fusionauth/config
# - ./kickstart:/usr/local/fusionauth/kickstart

networks:
db_net:
Expand Down

0 comments on commit 770b221

Please sign in to comment.