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:
@ -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"]
|
Reference in New Issue
Block a user