Skip to content

Commit

Permalink
refs #000: Refactor build
Browse files Browse the repository at this point in the history
  • Loading branch information
paolomainardi authored Jan 15, 2024
1 parent 272e973 commit 9868dc9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18-alpine
FROM node:18-alpine as dev
LABEL author="Paolo Pustorino <[email protected]>"

# Variables
Expand All @@ -10,8 +10,7 @@ WORKDIR $INSTALL_DIR

# Copy content and configuration
COPY ./custom/server.js ./
COPY ./custom/package.json ./
COPY ./custom/package-lock.json ./
COPY ./custom/package* ./
COPY ./custom/config.js ./config.js
COPY ./custom/themes ./themes
COPY ./content ./content
Expand All @@ -24,4 +23,8 @@ EXPOSE $PORT
# Configure the entrypoint script
COPY build/node/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
CMD ["npm run start"]
ENTRYPOINT ["/entrypoint.sh"]

FROM dev as prod
RUN cd custom && npm install
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
version: "3"
services:
documentation:
build: .
build:
context: .
target: dev
environment:
- VIRTUAL_HOST=playbook.sparkfabrik.loc
command: npm run start
volumes:
- ./assets:/opt/raneto/assets
- ./content:/opt/raneto/content
Expand Down

0 comments on commit 9868dc9

Please sign in to comment.