forked from thematters/fullstack-challenge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile_frontend
30 lines (27 loc) · 1.38 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
FROM node:20.11.1-bullseye-slim
RUN mkdir -p /home/app/
WORKDIR /home/app
COPY . .
RUN rm -rf node_modules || true
RUN find ./packages -mindepth 1 -maxdepth 1 -type d | grep -Ev './(packages/frontend)' | xargs rm -r
RUN rm -rf packages/frontend/.next || true
RUN npm install
RUN rm ./packages/frontend/.env || true
RUN rm ./packages/frontend/.env.* || true
RUN echo "NEXTJS_PUBLIC_IPFS_URL=http://ipfs:3002/cat/" >> ./packages/frontend/.env
RUN echo "GRAPHQL_BACKEND_URL=http://graphql_server:3000/graphql" >> ./packages/frontend/.env
# FROM node:20.11.1-bullseye-slim
# RUN mkdir -p /home/app/
# WORKDIR /home/app
# COPY --from=builder /home/app/package.json /home/app/
# COPY --from=builder /home/app/package-lock.json /home/app/
# RUN mkdir -p /home/app/packages && mkdir -p /home/app/packages/frontend/public && mkdir -p /home/app/packages/frontend/.next/static
# RUN npm install --omit=dev
# COPY --from=builder /home/app/packages/frontend/.next/standalone/packages /home/app/packages
# COPY --from=builder /home/app/packages/frontend/.next/static /home/app/packages/frontend/.next/static
# COPY --from=builder /home/app/packages/frontend/public /home/app/packages/frontend/public
# COPY --from=builder /home/app/packages/frontend/.next/standalone/node_modules /home/app/node_modules
COPY ./scripts/frontend.sh /home/app/
RUN chmod +x /home/app/frontend.sh
EXPOSE 3000
ENTRYPOINT [ "/home/app/frontend.sh" ]