Skip to content

Instantly share code, notes, and snippets.

@ewingson
Created May 9, 2023 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ewingson/06156bbe8ad9b0eb8c45303edc4540be to your computer and use it in GitHub Desktop.
Save ewingson/06156bbe8ad9b0eb8c45303edc4540be to your computer and use it in GitHub Desktop.
# Build stage
FROM node:lts-alpine AS build
# Set current working directory
WORKDIR ./ #changed here
# Copy the dockerfile's context's community server files
COPY . .
# Install and build the Solid community server (prepare script cannot run in wd)
# RUN npm ci --unsafe-perm && npm run build
# RUN npm ci --omit-dev && npm run build #commented out
# Runtime stage
FROM node:lts-alpine
# Add contact informations for questions about the container
LABEL maintainer="rpio experimental docker mashlib <me@evering.eu>"
# Container config & data dir for volume sharing
# Defaults to filestorage with /data directory (passed through CMD below)
RUN mkdir /config /data
# Set current directory
WORKDIR ./
# Copy runtime files from build stage
COPY --from=build ./node_modules/@solid/community-server/package.json . #changed build path
COPY --from=build ./node_modules/@solid/community-server/bin ./bin
COPY --from=build ./node_modules/@solid/community-server/config ./config
COPY --from=build ./node_modules/@solid/community-server/dist ./dist
COPY --from=build ./node_modules/@solid/community-server/node_modules ./node_modules
COPY --from=build ./node_modules/@solid/community-server/templates ./templates
# Informs Docker that the container listens on the specified network port at runtime
EXPOSE 3000
# Set command run by the container
ENTRYPOINT [ "node", "bin/server.js" ]
# By default run in filemode (overriden if passing alternative arguments or env vars) [yes]
ENV CSS_CONFIG=config/config-mashlib.json
ENV CSS_ROOT_FILE_PATH=/data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment