23 lines
572 B
Docker
23 lines
572 B
Docker
FROM node:16
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
COPY picture-gallery-client/package*.json picture-gallery-client/
|
|
COPY picture-gallery-server/package*.json picture-gallery-server/
|
|
|
|
# build client
|
|
WORKDIR /usr/src/app/picture-gallery-client
|
|
RUN npm ci --only=production
|
|
COPY picture-gallery-client .
|
|
RUN npm run build
|
|
|
|
# build server
|
|
WORKDIR /usr/src/app/picture-gallery-server
|
|
RUN npm ci --only=production
|
|
COPY picture-gallery-server .
|
|
RUN npm run build
|
|
|
|
VOLUME /usr/src/app/public
|
|
EXPOSE 3001
|
|
# we are still in the server directory
|
|
CMD [ "node", "dist/app.js" ] |