Skip to content

Commit 4615a1a

Browse files
committed
Update cloud deployment configuration
1 parent fb1ac74 commit 4615a1a

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

frontend/Dockerfile.cloud

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# From repository root folder
33
# docker build --build-arg ENV=development -t police-data-trust-frontend-dev -f frontend/Dockerfile.cloud ./frontend
44

5-
FROM node:20-bookworm-slim as builder
5+
FROM node:20-bookworm-slim AS builder
66

7-
WORKDIR /app/
7+
WORKDIR /app
88
ARG ENV
99

1010
COPY package*.json ./
@@ -14,7 +14,17 @@ COPY . .
1414

1515
RUN npm run build:${ENV}
1616

17-
FROM nginx:1.27-bookworm
18-
COPY --from=builder /app/out /usr/share/nginx/html
19-
COPY --from=builder /app/nginx/default.conf /etc/nginx/conf.d/default.conf
20-
EXPOSE 80
17+
FROM node:20-bookworm-slim AS runner
18+
19+
WORKDIR /app
20+
ENV NODE_ENV=production
21+
ENV PORT=3000
22+
ENV HOSTNAME=0.0.0.0
23+
24+
COPY --from=builder /app/.next/standalone ./
25+
COPY --from=builder /app/.next/static ./.next/static
26+
COPY --from=builder /app/public ./public
27+
28+
EXPOSE 3000
29+
30+
CMD ["node", "server.js"]

frontend/next.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { NextConfig } from "next"
22

33
const nextConfig: NextConfig = {
44
/* config options here */
5+
output: "standalone",
56
}
67

78
export default nextConfig

0 commit comments

Comments
 (0)