Skip to content

Commit c7dee87

Browse files
committed
fix: updates dockerfile and ci file
1 parent ee6777d commit c7dee87

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

.dockerignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ dist
88
.next
99
.vscode
1010
docker-compose*.yml
11-
Dockerfile*
11+
Dockerfile*
12+
.github

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
1818

1919
- name: Build the Docker image
20-
run: docker build -t nextjs-socket-io-demo .
20+
run: docker build -f Dockerfile.production -t nextjs-socket-io-demo .
2121
- name: Add the tag for the Docker image
2222
run: docker tag nextjs-socket-io-demo othytenk/nextjs-socket-io-demo:latest
2323
- name: Push to Dockerhub

Dockerfile.production

+4-2
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-l
3131

3232
#STAGE 3
3333
FROM base AS builder
34+
RUN apk add --no-cache libc6-compat
35+
3436
COPY --from=deps /app/node_modules ./node_modules
3537

3638
#Copy config files
3739
COPY next.config.js ./next.config.js
38-
# COPY next-env.d.ts ./next-env.d.ts
3940
COPY postcss.config.js ./postcss.config.js
4041
COPY tailwind.config.ts ./tailwind.config.ts
4142

@@ -52,14 +53,15 @@ WORKDIR /app
5253

5354
# Set production environment
5455
ENV NODE_ENV production
55-
# ENV NEXT_TELEMETRY_DISABLED 1
56+
ENV NEXT_TELEMETRY_DISABLED 1
5657

5758
RUN addgroup --system --gid 1001 nodejs
5859
RUN adduser --system --uid 1001 nextjs
5960

6061
COPY --from=builder /app/public ./public
6162
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
6263
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
64+
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./
6365

6466
USER nextjs
6567

docker-compose.test.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: '3'
2+
3+
services:
4+
app:
5+
hostname: testdocket
6+
image: othytenk/nextjs-socket-io-demo:latest
7+
ports:
8+
- 3000:3000

0 commit comments

Comments
 (0)