Skip to content

Commit

Permalink
create dockerfile to build project image container
Browse files Browse the repository at this point in the history
  • Loading branch information
j-pcgoncalves committed Dec 1, 2023
1 parent 996817b commit c3e8226
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git

*/node_modules

server/public
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM node:lts-alpine

WORKDIR /app

COPY package*.json ./

COPY client/package*.json client/
RUN npm run install-client --omit=dev

COPY server/package*.json server/
RUN npm run install-server --omit=dev

COPY client/ client/
RUN npm run build --prefix client

COPY server/ server/

USER node

CMD [ "npm", "start", "--prefix", "server" ]

EXPOSE 8000
2 changes: 1 addition & 1 deletion client/src/hooks/requests.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const API_URL = "http://localhost:8000/v1";
const API_URL = "v1";

// Load planets and return as JSON
async function httpGetPlanets() {
Expand Down

0 comments on commit c3e8226

Please sign in to comment.