Add initial schema for entries and settings tables

- Created 'entries' table to track time entries with fields for date, start time, end time, pause minutes, location, and entry type.
- Created 'settings' table to store key-value pairs for application settings with an updated timestamp.
This commit is contained in:
Felix Schlusche
2025-10-23 14:27:25 +02:00
parent b2823731f1
commit b0dd773fba
10 changed files with 1345 additions and 308 deletions

View File

@@ -16,8 +16,7 @@ WORKDIR /app
COPY package*.json ./
# Install only production dependencies
# Using npm ci for reproducible builds
RUN npm ci --only=production && \
RUN npm install --omit=dev && \
npm cache clean --force
# ============================================
@@ -30,26 +29,17 @@ WORKDIR /app
# Install dumb-init for proper signal handling
RUN apk add --no-cache dumb-init
# Create non-root user for security
RUN addgroup -g 1001 -S nodejs && \
adduser -S nodejs -u 1001
# Copy dependencies from builder stage
COPY --from=builder /app/node_modules ./node_modules
# Copy application files
COPY --chown=nodejs:nodejs server.js ./
COPY --chown=nodejs:nodejs package*.json ./
COPY --chown=nodejs:nodejs src ./src
COPY --chown=nodejs:nodejs db ./db
COPY --chown=nodejs:nodejs public ./public
COPY server.js ./
COPY schema.sql ./
COPY package*.json ./
COPY public ./public
# Create data directory for SQLite database with proper permissions
RUN mkdir -p /app/db && \
chown -R nodejs:nodejs /app/db
# Switch to non-root user
USER nodejs
# Create data directory for SQLite database
RUN mkdir -p /app/db
# Expose the application port
EXPOSE 3000