Refactor Docker setup and migrate to PostgreSQL

Streamlined Dockerfiles with clearer ENV variables and build args. Switched backend database from MySQL to PostgreSQL, updated configurations accordingly, and added robust Docker Compose services for better orchestration, including health checks and persistent storage.
This commit is contained in:
GotthardG
2025-04-09 15:09:22 +02:00
parent 248085b3c4
commit bb6cca4f23
11 changed files with 192 additions and 95 deletions

View File

@ -2,6 +2,17 @@ FROM node:18-alpine
WORKDIR /app
# Setup build args clearly
ARG VITE_OPENAPI_BASE_DEV
ARG VITE_SSL_KEY_PATH
ARG VITE_SSL_CERT_PATH
ARG NODE_ENV=development
ENV VITE_OPENAPI_BASE_DEV=${VITE_OPENAPI_BASE_DEV}
ENV VITE_SSL_KEY_PATH=${VITE_SSL_KEY_PATH}
ENV VITE_SSL_CERT_PATH=${VITE_SSL_CERT_PATH}
ENV NODE_ENV=${NODE_ENV}
# Copy only the necessary package files first
COPY package*.json ./
RUN npm install
@ -14,3 +25,8 @@ COPY . .
# Build the application
RUN npm run build
# Use a simple HTTP server to serve the built static files
EXPOSE 3000
CMD ["npm", "run", "start-dev"]