1
0
forked from noxious/server

Updated Dockerfile

This commit is contained in:
Dennis Postma 2025-02-07 22:29:21 +01:00
parent cff5fed4f7
commit a7726387af

View File

@ -1,11 +1,3 @@
# Build stage
FROM node:23.7.0-alpine AS builder
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm ci
COPY . .
# Production stage
FROM node:23.7.0-alpine
# Install dependencies with versions
@ -24,12 +16,12 @@ RUN mkdir -p /run/mysqld && \
mysql_install_db --user=mysql --datadir=/var/lib/mysql
WORKDIR /usr/src/app
COPY --from=builder /usr/src/app/dist ./dist
COPY --from=builder /usr/src/app/package*.json ./
COPY docker-start.sh ./dist/start.sh
COPY package*.json ./
COPY start.sh ./
COPY . .
RUN npm ci --only=production && \
chmod +x ./dist/start.sh && \
chmod +x ./start.sh && \
chown -R appuser:appgroup .
USER appuser
@ -39,4 +31,4 @@ EXPOSE 80 6379 3306
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD mysqladmin ping -h localhost || exit 1
CMD ["./dist/start.sh"]
CMD ["./start.sh"]