Skip to content

Commit bb20a24

Browse files
authored
Merge pull request #1 from mustafa854/workflows
feat(docker): initial setup of Docker
2 parents 049a17d + 8dc8679 commit bb20a24

File tree

5 files changed

+7984
-1147
lines changed

5 files changed

+7984
-1147
lines changed

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
npm-debug.log
3+
build
4+
.dockerignore
5+
**/.git
6+
**/.DS_Store
7+
**/node_modules

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Base image
2+
FROM node:18-alpine AS base
3+
WORKDIR /app
4+
5+
COPY package.json /app/package.json
6+
COPY package-lock.json /app/package-lock.json
7+
8+
ARG ENV=production
9+
RUN if [ "$ENV" = "development" ]; then npm install; else npm ci --only=production; fi
10+
11+
COPY . /app
12+
13+
# Stage for production builds
14+
FROM node:18-alpine AS production
15+
WORKDIR /app
16+
COPY --from=base /app /app
17+
18+
# Set environment variable for production
19+
ENV NODE_ENV=production
20+
ENV PORT=3000
21+
22+
EXPOSE 3000
23+
CMD [ "npm", "start" ]

0 commit comments

Comments
 (0)