Initial docker file and stuff

This commit is contained in:
2023-09-24 17:41:48 -04:00
parent 9cf92b8c1f
commit 8d60a19b44
9 changed files with 5321 additions and 6 deletions

1
ui/.nvmrc Normal file
View File

@@ -0,0 +1 @@
18.17.1

38
ui/Dockerfile Normal file
View File

@@ -0,0 +1,38 @@
# Base
FROM node:18-alpine AS base
# Dependencies
FROM base as deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
# Dev
FROM base AS dev
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Builder
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build
# Runner
FROM base AS runner
WORKDIR /app
RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 nextjs
COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
USER nextjs
EXPOSE 3000
ENV PORT 3000
ENV NEXT_TELEMETRY_DISABLED 1
CMD ["node", "server.js"]

View File

@@ -4,7 +4,19 @@ const nextConfig = {
swcMinify: true,
eslint: {
ignoreDuringBuilds: true
}
},
webpackDevMiddleware: (config) => {
config.watchOptions = {
poll: 1000,
aggregateTimeout: 300
};
return config;
},
publicRuntimeConfig: {
// remove private variables from processEnv
processEnv: Object.fromEntries(Object.entries(process.env).filter(([key]) => key.includes('NEXT_PUBLIC_')))
},
output: 'standalone'
};
module.exports = nextConfig;

5222
ui/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -60,7 +60,6 @@ export default function MapTiles() {
}
function iconSize() {
console.log('zoom', zoomLevel);
if (zoomLevel <= 4) {
return 'text-xs';
} else if (zoomLevel <= 5) {