Skip to content

Commit

Permalink
updating base url syntax and dockerfile usage
Browse files Browse the repository at this point in the history
  • Loading branch information
havok2063 committed May 9, 2024
1 parent 0a3af2e commit df9f1dc
Show file tree
Hide file tree
Showing 8 changed files with 221 additions and 172 deletions.
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
VITE_API_URL=http://localhost:8000
VITE_BASE_URL=/
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
VITE_API_URL=https://api.sdss.org/valis
VITE_BASE_URL=/zora/
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ RUN npm install
COPY ./ .

# Copy the custom .env.docker file
COPY .env.docker .env.production
COPY .env.production .env.production

# set the base URL environment variable
ENV BASE_URL=zora

# Build the Vue.js app
RUN npm run build
Expand All @@ -25,4 +28,4 @@ LABEL org.opencontainers.image.description "zora production image"

# Copy the files to mountable directory
RUN mkdir -p /app/html
CMD ["cp", "-r", "/app/dist/.", "/app/html"]
CMD ["cp", "-r", "/app/dist/.", "/app/html"]
368 changes: 205 additions & 163 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "zora",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "run-p type-check build-only",
Expand Down
2 changes: 1 addition & 1 deletion src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const routes = [
]

const router = createRouter({
history: createWebHistory(process.env.BASE_URL),
history: createWebHistory(import.meta.env.VITE_BASE_URL),
routes
})

Expand Down
11 changes: 6 additions & 5 deletions tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
{
"compilerOptions": {
"baseUrl": ".",
"target": "esnext",
"target": "ESNext",
"useDefineForClassFields": true,
"allowSyntheticDefaultImports": true,
"composite": true,
"module": "esnext",
"module": "ESNext",
"moduleResolution": "node",
"strict": true,
"jsx": "preserve",
"sourceMap": false,
"resolveJsonModule": true,
"esModuleInterop": true,
"lib": ["esnext", "dom"],
"lib": ["ESNext", "DOM"],
"types": [
"node",
"vuetify"
"@types/node",
"vuetify",
"vite/client",
],
"paths": {
"@/*": ["src/*"]
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export default defineConfig({
'.vue',
],
},
base: process.env.BASE_URL || "/",
server: {
base: "/",
port: 3000,
host: "0.0.0.0"
},
Expand Down

0 comments on commit df9f1dc

Please sign in to comment.