forked from noxious/server
Updated Dockerfile
This commit is contained in:
parent
cff5fed4f7
commit
a7726387af
18
Dockerfile
18
Dockerfile
@ -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
|
FROM node:23.7.0-alpine
|
||||||
|
|
||||||
# Install dependencies with versions
|
# Install dependencies with versions
|
||||||
@ -24,12 +16,12 @@ RUN mkdir -p /run/mysqld && \
|
|||||||
mysql_install_db --user=mysql --datadir=/var/lib/mysql
|
mysql_install_db --user=mysql --datadir=/var/lib/mysql
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
COPY --from=builder /usr/src/app/dist ./dist
|
COPY package*.json ./
|
||||||
COPY --from=builder /usr/src/app/package*.json ./
|
COPY start.sh ./
|
||||||
COPY docker-start.sh ./dist/start.sh
|
COPY . .
|
||||||
|
|
||||||
RUN npm ci --only=production && \
|
RUN npm ci --only=production && \
|
||||||
chmod +x ./dist/start.sh && \
|
chmod +x ./start.sh && \
|
||||||
chown -R appuser:appgroup .
|
chown -R appuser:appgroup .
|
||||||
|
|
||||||
USER appuser
|
USER appuser
|
||||||
@ -39,4 +31,4 @@ EXPOSE 80 6379 3306
|
|||||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||||
CMD mysqladmin ping -h localhost || exit 1
|
CMD mysqladmin ping -h localhost || exit 1
|
||||||
|
|
||||||
CMD ["./dist/start.sh"]
|
CMD ["./start.sh"]
|
Loading…
x
Reference in New Issue
Block a user