Skip to content

Commit 6404821

Browse files
committed
Upgrades and add dockerfile
1 parent 59a2f19 commit 6404821

File tree

11 files changed

+285
-285
lines changed

11 files changed

+285
-285
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id 'org.springframework.boot' version '3.0.5'
3+
id 'org.springframework.boot' version '3.2.1'
44
id 'io.spring.dependency-management' version '1.1.0'
55
}
66

frontend/Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM node:lts-slim AS builder
2+
WORKDIR /app
3+
4+
# Copy source code
5+
COPY . .
6+
7+
# Install dependencies
8+
ARG SETUP_COMMAND="npm install"
9+
RUN ${SETUP_COMMAND}
10+
11+
# Build nextjs app
12+
ARG BUILD_COMMAND="npm run build"
13+
RUN ${BUILD_COMMAND}
14+
15+
# Production image, copy all the files and run next
16+
FROM builder
17+
18+
WORKDIR /app
19+
20+
RUN addgroup --gid 1001 nodejs
21+
RUN adduser --disabled-password --gecos "" --uid 1001 --ingroup nodejs nextjs
22+
COPY --from=builder /app/next.config.js ./
23+
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
24+
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
25+
26+
USER nextjs
27+
28+
EXPOSE 80
29+
ENV PORT 80
30+
31+
CMD ["node", "server.js"]

frontend/next.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const nextConfig = {
44
images: {
55
domains: ['cdn.hashnode.com'],
66
},
7+
output: 'standalone'
78
}
89

910
module.exports = nextConfig

0 commit comments

Comments
 (0)