yurrrr
This commit is contained in:
parent
2ca0d487a5
commit
47ab660fd0
33
Dockerfile
Normal file
33
Dockerfile
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# Use the official Node.js 20.2.0 image with Alpine Linux as the base image
|
||||||
|
FROM node:20.9.0-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
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
# Build the application
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
# Copy the rest of your application code to the container
|
||||||
|
COPY . /usr/src/app
|
||||||
|
|
||||||
|
# Expose the port your Node.js application will listen on
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
|
# Set environment variables (e.g., your SECRET)
|
||||||
|
ENV JWT_SECRET=secret \
|
||||||
|
DATABASE_URL=mysql://root:BEVLqLReqUyA@srv-captain--nq-db:3306/new-quest
|
||||||
|
|
||||||
|
# Use nodemon for development (install it globally)
|
||||||
|
RUN npm install -g nodemon
|
||||||
|
|
||||||
|
# Define the startup command using nodemon
|
||||||
|
CMD ["nodemon", "dist/server.js"]
|
@ -1,12 +1,4 @@
|
|||||||
{
|
{
|
||||||
"schemaVersion": 2,
|
"schemaVersion": 2,
|
||||||
"dockerfileLines": [
|
"dockerfilePath" :"./Dockerfile"
|
||||||
"FROM node:22.4.1-alpine",
|
|
||||||
"RUN mkdir -p /usr/src/app",
|
|
||||||
"WORKDIR /usr/src/app",
|
|
||||||
"COPY ./ /usr/src/app",
|
|
||||||
"RUN npm install && npm cache clean --force && npm run build",
|
|
||||||
"EXPOSE 4000",
|
|
||||||
"CMD [ \"npm\", \"start\" ]"
|
|
||||||
]
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user