1
0
forked from noxious/server
noxious_server/Dockerfile

33 lines
877 B
Docker

# Use the official Node.js 22.4.1 image
FROM node:23.7.0-alpine
# Install Redis, MySQL, and tmux
RUN apk add --no-cache redis mysql mysql-client tmux && \
mkdir -p /run/mysqld && \
chown -R mysql:mysql /run/mysqld && \
mysql_install_db --user=mysql --datadir=/var/lib/mysql
# Set the working directory in the container
WORKDIR /usr/src/
# Copy package.json and package-lock.json (if available)
COPY package*.json ./
# Install application dependencies
RUN npm install
# Copy the rest of your application code to the container
COPY . .
# Build the application
RUN npm run build
# Expose the ports your Node.js application, Redis, and MySQL will listen on
EXPOSE 80 6379 3306
# Copy and make the startup script executable
COPY docker-start.sh /usr/src/start.sh
RUN chmod +x /usr/src/start.sh
# Use the shell script as the entry point
CMD ["/usr/src/start.sh"]