Use separate MariaDB container
This commit is contained in:
+9
-6
@@ -9,13 +9,16 @@ RUN npm ci
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: Full stack with MariaDB
|
||||
# Stage 2: App only (no MariaDB)
|
||||
FROM node:20-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
RUN apk add --no-cache mariadb mariadb-client mariadb-server-utils nginx bash
|
||||
# Install nginx
|
||||
RUN apk add --no-cache nginx bash
|
||||
|
||||
# Copy built frontend to nginx
|
||||
COPY --from=builder /build/dist /usr/share/nginx/html
|
||||
|
||||
# Copy server files
|
||||
COPY server/package*.json ./server/
|
||||
@@ -27,15 +30,15 @@ COPY server/ ./server/
|
||||
COPY nginx.conf /etc/nginx/http.d/default.conf
|
||||
|
||||
# Create directories
|
||||
RUN mkdir -p /run/nginx /run/mysqld /var/lib/mysql
|
||||
RUN mkdir -p /run/nginx
|
||||
|
||||
# Copy entrypoint
|
||||
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
||||
RUN chmod +x /docker-entrypoint.sh
|
||||
|
||||
EXPOSE 80 4000 3306
|
||||
EXPOSE 80 4000
|
||||
|
||||
ENV DB_HOST=localhost
|
||||
ENV DB_HOST=db
|
||||
ENV DB_PORT=3306
|
||||
ENV DB_USER=hospital
|
||||
ENV DB_PASSWORD=hospital123
|
||||
|
||||
Reference in New Issue
Block a user