forked from noxious/server
awsadsdfijer
This commit is contained in:
parent
aec3f33f69
commit
b77ec0fecf
22
Dockerfile
22
Dockerfile
@ -1,30 +1,26 @@
|
|||||||
# Use the official Node.js 20.2.0 image with Alpine Linux as the base image
|
# Use the official Node.js 22.4.1 image
|
||||||
FROM node:22.4.1-alpine
|
FROM node:22.4.1-alpine
|
||||||
|
|
||||||
# Create a directory for the application code
|
|
||||||
RUN mkdir -p /usr/src/app
|
|
||||||
|
|
||||||
# Set the working directory in the container
|
|
||||||
WORKDIR /usr/src/app
|
|
||||||
|
|
||||||
# Copy the package.json and package-lock.json files to the container
|
|
||||||
COPY package*.json /usr/src/app/
|
|
||||||
|
|
||||||
# Install application dependencies
|
# Install application dependencies
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
# Build the application
|
# Build the application
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
# Create a directory for the application code
|
||||||
|
RUN mkdir -p /usr/src/app
|
||||||
|
|
||||||
|
# Set the working directory in the container
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
# Copy the rest of your application code to the container
|
# Copy the rest of your application code to the container
|
||||||
COPY . /usr/src/app
|
COPY . /usr/src/app
|
||||||
|
|
||||||
# Expose the port your Node.js application will listen on
|
# Expose the port your Node.js application will listen on
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
# Set environment variables (e.g., your SECRET)
|
# Set environment variables
|
||||||
ENV JWT_SECRET=secret \
|
ENV DATABASE_URL=mysql://root:BEVLqLReqUyA@srv-captain--nq-db:3306/new-quest
|
||||||
DATABASE_URL=mysql://root:BEVLqLReqUyA@srv-captain--nq-db:3306/new-quest
|
|
||||||
|
|
||||||
# Use nodemon for development (install it globally)
|
# Use nodemon for development (install it globally)
|
||||||
RUN npm install -g nodemon
|
RUN npm install -g nodemon
|
||||||
|
Loading…
x
Reference in New Issue
Block a user