-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.dev
43 lines (30 loc) · 844 Bytes
/
Dockerfile.dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM node:lts
# Create app directory
WORKDIR /usr/src/app
# Install global dependencies
RUN npm install -g npm@latest && npm cache clean --force
# Copy package files first to leverage Docker cache
COPY --chown=node:node package*.json ./
# Clear npm cache and install dependencies
RUN npm cache clean --force && npm i
# Copy the rest of the application code
COPY --chown=node:node . .
# Set environment variables
ENV API_URL=https://api.news.vedina.ir
ENV PORT=3000
ENV APP_VERSION=1.0.0
ENV TZ = 'Asia/Tehran'
ENV DB_HOST=mysql
ENV DB_NAME=news_blog
ENV DB_USER=news_blog
ENV DB_PASSWORD=
ENV REDIS_HOST=redis
ENV REDIS_PORT=6379
ENV REDIS_PASSWORD=
ENV JWT_SECRET=""
# Expose the port the app runs on
EXPOSE 3000
# Switch to non-root user
USER node
# Default command (can be overridden in docker-compose)
CMD ["npm", "run", "dev"]