ChandimaPrabath
commited on
Commit
•
cb363ec
1
Parent(s):
74841d4
update Dockerfile
Browse files- Dockerfile +3 -9
- frontend/next.config.mjs +3 -5
Dockerfile
CHANGED
@@ -17,14 +17,11 @@ RUN npm install -g pm2
|
|
17 |
# Stage 2: Run the Next.js application with PM2
|
18 |
FROM node:20-alpine
|
19 |
|
20 |
-
|
|
|
21 |
|
22 |
# Copy the Next.js build and node_modules from the builder stage
|
23 |
-
COPY --from=builder /app /
|
24 |
-
|
25 |
-
# Create the cache directory in /tmp and set permissions
|
26 |
-
RUN mkdir -p /tmp/app/.next/cache && \
|
27 |
-
chmod -R 777 /tmp/app/.next
|
28 |
|
29 |
# Install PM2 globally
|
30 |
RUN npm install -g pm2
|
@@ -35,8 +32,5 @@ EXPOSE 7860
|
|
35 |
# Set the PORT environment variable
|
36 |
ENV PORT=7860
|
37 |
|
38 |
-
# Set Next.js environment variables to use the /tmp cache directory
|
39 |
-
ENV NEXT_CACHE_DIR=/tmp/app/.next/cache
|
40 |
-
|
41 |
# Start Next.js with PM2
|
42 |
CMD ["pm2-runtime", "start", "npm", "--", "start"]
|
|
|
17 |
# Stage 2: Run the Next.js application with PM2
|
18 |
FROM node:20-alpine
|
19 |
|
20 |
+
# Working directory set to /tmp due to write permissions
|
21 |
+
WORKDIR /tmp
|
22 |
|
23 |
# Copy the Next.js build and node_modules from the builder stage
|
24 |
+
COPY --from=builder /app /tmp
|
|
|
|
|
|
|
|
|
25 |
|
26 |
# Install PM2 globally
|
27 |
RUN npm install -g pm2
|
|
|
32 |
# Set the PORT environment variable
|
33 |
ENV PORT=7860
|
34 |
|
|
|
|
|
|
|
35 |
# Start Next.js with PM2
|
36 |
CMD ["pm2-runtime", "start", "npm", "--", "start"]
|
frontend/next.config.mjs
CHANGED
@@ -1,10 +1,8 @@
|
|
1 |
/** @type {import('next').NextConfig} */
|
2 |
const nextConfig = {
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
cacheDirPath: "/tmp/app/.next/cache",
|
7 |
-
},
|
8 |
};
|
9 |
|
10 |
export default nextConfig;
|
|
|
1 |
/** @type {import('next').NextConfig} */
|
2 |
const nextConfig = {
|
3 |
+
images: {
|
4 |
+
domains: ['artworks.thetvdb.com'],
|
5 |
+
},
|
|
|
|
|
6 |
};
|
7 |
|
8 |
export default nextConfig;
|