Skip to content

Commit

Permalink
zess: set production env variables for vinvoor
Browse files Browse the repository at this point in the history
  • Loading branch information
Topvennie authored and hannes-dev committed Aug 26, 2024
1 parent b6df557 commit a56d727
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ RUN yarn install

COPY vinvoor/ .

COPY vinvoor/production.env .env

RUN yarn run build


Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Both the backend and the frontend support hot module reloading (HMR).
## Production

- Install Docker
- Set the environment variables for the frontend before building (see the [README in ./vinvoor](vinvoor/README.md))
- Set the required env variables for vinvoor in `vinvoor/production.env` _before_ building (see the [README in ./vinvoor](vinvoor/README.md))
- Build the image `docker build -t zess .`
- Set the required variables in a `.env` file for the backend (see the [README in ./vingo](vingo/README.md))
- Run the image `docker run -v ${PWD}/.env:/.env zess`
Expand Down
31 changes: 31 additions & 0 deletions vinvoor/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

.vite/
bin/
pkg/
*.env

test.js
1 change: 1 addition & 0 deletions vinvoor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ That's what this does!
## Environment variables

For production the environment variables need to be set before building!
You can specify them in `production.env` which will be used by the Dockerfile

- VITE_BACKEND_URL (string) | URL for the backend
- VITE_DEFAULT_THEME_MODE (string) | Default theme for the frontend
3 changes: 3 additions & 0 deletions vinvoor/production.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
VITE_BACKEND_URL="http://localhost:4000"

VITE_DEFAULT_THEME_MODE="light"

0 comments on commit a56d727

Please sign in to comment.