-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4ca7042
commit 193cd55
Showing
1 changed file
with
48 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,52 @@ | ||
FROM node:lts-alpine | ||
# FROM node:lts-alpine | ||
|
||
LABEL name="Docusaurus on docker latest-stable" \ | ||
maintainer="VolvoxLLC <[email protected]>" \ | ||
version="1.0.0" \ | ||
release="latest" \ | ||
url="https://github.com/VolvoxLLC/Volvox.Apollo.Docs" \ | ||
summary="Volvox.Apollo Docs Docker \ | ||
on Node 20.x, lts-alpine" \ | ||
description="Volvox.Apollo Docs \ | ||
on Node 20.x, lts-alpine" | ||
# LABEL name="Docusaurus on docker latest-stable" \ | ||
# maintainer="VolvoxLLC <[email protected]>" \ | ||
# version="1.0.0" \ | ||
# release="latest" \ | ||
# url="https://github.com/VolvoxLLC/Volvox.Apollo.Docs" \ | ||
# summary="Volvox.Apollo Docs Docker \ | ||
# on Node 20.x, lts-alpine" \ | ||
# description="Volvox.Apollo Docs \ | ||
# on Node 20.x, lts-alpine" | ||
|
||
# run as our node user from base image | ||
# we delete the dockerfiles we don't need | ||
# this leaves us with a default v1 docusarus install | ||
# we can mount our own into the container | ||
USER node | ||
RUN mkdir ~/npm-global \ | ||
&& npm config set prefix '~/npm-global' \ | ||
&& echo 'export PATH=~/npm-global/bin:$PATH' > ~/.profile \ | ||
&& mkdir -p /home/node/docs \ | ||
&& cd /home/node/docs \ | ||
&& npm install --global docusaurus-init \ | ||
&& sh -l -c docusaurus-init \ | ||
&& rm Dockerfile \ | ||
&& rm docker-compose.yml | ||
# # run as our node user from base image | ||
# # we delete the dockerfiles we don't need | ||
# # this leaves us with a default v1 docusarus install | ||
# # we can mount our own into the container | ||
# USER node | ||
# RUN mkdir ~/npm-global \ | ||
# && npm config set prefix '~/npm-global' \ | ||
# && echo 'export PATH=~/npm-global/bin:$PATH' > ~/.profile \ | ||
# && mkdir -p /home/node/docs \ | ||
# && cd /home/node/docs \ | ||
# && npm install --global docusaurus-init \ | ||
# && sh -l -c docusaurus-init | ||
|
||
EXPOSE 5001/tcp | ||
USER node | ||
WORKDIR /home/node/docs | ||
# EXPOSE 5001/tcp | ||
# USER node | ||
# WORKDIR /home/node/docs | ||
|
||
# CMD ["sh", "-l", "-c", "npm run serve"] | ||
|
||
CMD ["sh", "-l", "-c", "npm run serve"] | ||
## Base ######################################################################## | ||
# Use a larger node image to do the build for native deps (e.g., gcc, python) | ||
FROM node:lts as base | ||
|
||
# We'll run the app as the `node` user, so put it in their home directory | ||
WORKDIR /home/node/app | ||
# Copy the source code over | ||
COPY --chown=node:node . /home/node/app/ | ||
|
||
## Development ################################################################# | ||
# Define a development target that installs devDeps and runs in dev mode | ||
FROM base as development | ||
WORKDIR /home/node/app | ||
# Install (not ci) with dependencies, and for Linux vs. Linux Musl (which we use for -alpine) | ||
RUN npm install | ||
# Switch to the node user vs. root | ||
USER node | ||
# Expose port 5000 | ||
EXPOSE 5000 | ||
# Start the app in debug mode so we can attach the debugger | ||
CMD ["npm", "serve"] |