Use separate MariaDB container

This commit is contained in:
2026-04-24 17:29:07 -03:00
parent 91836d44fe
commit a3ead13ec6
3 changed files with 33 additions and 38 deletions
+9 -6
View File
@@ -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