diff --git a/Dockerfile b/Dockerfile index 4153da0..b9e1e68 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,6 +36,8 @@ RUN yarn install COPY vinvoor/ . +COPY vinvoor/production.env .env + RUN yarn run build diff --git a/README.md b/README.md index 4dab1da..c9aea1b 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,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` diff --git a/vinvoor/.dockerignore b/vinvoor/.dockerignore new file mode 100644 index 0000000..2a1871b --- /dev/null +++ b/vinvoor/.dockerignore @@ -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 diff --git a/vinvoor/README.md b/vinvoor/README.md index 481b81d..4cd19fe 100644 --- a/vinvoor/README.md +++ b/vinvoor/README.md @@ -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 diff --git a/vinvoor/production.env b/vinvoor/production.env new file mode 100644 index 0000000..317c45a --- /dev/null +++ b/vinvoor/production.env @@ -0,0 +1,3 @@ +VITE_BACKEND_URL="http://localhost:4000" + +VITE_DEFAULT_THEME_MODE="light"