-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.frontend
53 lines (42 loc) · 2.18 KB
/
Dockerfile.frontend
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Use the official Node.js image as the base image
FROM node:21-alpine
ARG EDGE_STORE_ACCESS_KEY=${EDGE_STORE_ACCESS_KEY}
ARG EDGE_STORE_SECRET_KEY=${EDGE_STORE_SECRET_KEY}
ARG NEXT_PUBLIC_USERS_API_URL=${NEXT_PUBLIC_USERS_API_URL}
ARG NEXT_PUBLIC_BLOGS_API_URL=${NEXT_PUBLIC_BLOGS_API_URL}
ARG NEXT_PUBLIC_COMMENT_API_URL=${NEXT_PUBLIC_COMMENT_API_URL}
ARG NEXT_PUBLIC_AUTH_API_URL=${NEXT_PUBLIC_AUTH_API_URL}
ARG NEXT_PUBLIC_FIREBASE_API_KEY=${NEXT_PUBLIC_FIREBASE_API_KEY}
ARG NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=${NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN}
ARG NEXT_PUBLIC_FIREBASE_PROJECT_ID=${NEXT_PUBLIC_FIREBASE_PROJECT_ID}
ARG NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=${NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET}
ARG NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=${NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID}
ARG NEXT_PUBLIC_FIREBASE_APP_ID=${NEXT_PUBLIC_FIREBASE_APP_ID}
ARG NEXT_PUBLIC_GRAPHQL_API_URL=${NEXT_PUBLIC_GRAPHQL_API_URL}
ENV EDGE_STORE_ACCESS_KEY=${EDGE_STORE_ACCESS_KEY}
ENV EDGE_STORE_SECRET_KEY=${EDGE_STORE_SECRET_KEY}
ENV NEXT_PUBLIC_USERS_API_URL=${NEXT_PUBLIC_USERS_API_URL}
ENV NEXT_PUBLIC_BLOGS_API_URL=${NEXT_PUBLIC_BLOGS_API_URL}
ENV NEXT_PUBLIC_COMMENT_API_URL=${NEXT_PUBLIC_COMMENT_API_URL}
ENV NEXT_PUBLIC_AUTH_API_URL=${NEXT_PUBLIC_AUTH_API_URL}
ENV NEXT_PUBLIC_FIREBASE_API_KEY=${NEXT_PUBLIC_FIREBASE_API_KEY}
ENV NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=${NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN}
ENV NEXT_PUBLIC_FIREBASE_PROJECT_ID=${NEXT_PUBLIC_FIREBASE_PROJECT_ID}
ENV NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=${NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET}
ENV NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=${NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID}
ENV NEXT_PUBLIC_FIREBASE_APP_ID=${NEXT_PUBLIC_FIREBASE_APP_ID}
ENV NEXT_PUBLIC_GRAPHQL_API_URL=${NEXT_PUBLIC_GRAPHQL_API_URL}
# Set the working directory inside the container
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY frontend/package*.json ./
# Install dependencies
RUN NODE_ENV=development npm ci
# Copy the rest of the application code to the working directory
COPY ./frontend .
# Build the Next.js application
RUN npm run build
# Expose the port that the Next.js server will listen on
EXPOSE 3000
# Start the Next.js server
CMD ["npm", "start"]