Add Dockerfiles and Docker instructions#26
Open
Vidminas wants to merge 1 commit intoCommunitySolidServer:mainfrom
Open
Add Dockerfiles and Docker instructions#26Vidminas wants to merge 1 commit intoCommunitySolidServer:mainfrom
Vidminas wants to merge 1 commit intoCommunitySolidServer:mainfrom
Conversation
Member
|
Assigning @Falx to this as he handles everything docker related in the CSS repo. The docker files are missing a trailing newline though. |
Falx
requested changes
Nov 14, 2022
Falx
left a comment
There was a problem hiding this comment.
I don't think the Dockerfiles of the CSS were specifically designed to be used as a base to build plugins on top of in a new Dockerfile. Instead I would use a simplified approach to build from scratch (as you essentially also do when building in nodejs):
# Build stage
FROM node:lts-alpine
# Set current working directory
WORKDIR /community-server
# Copy the package.json and package-lock.json files and any required docker context files (like a src folder)
COPY package*.json .
# Container config & data dir for volume sharing
# Defaults to filestorage with /data directory (passed through CMD below)
RUN mkdir /config /data
# Copy all config files to /config
COPY config* /config
# Install and build the Solid community server
RUN npm ci --unsafe-perm --omit=dev
# Remove src folder if present (not needed in container once built)
RUN rm -rf /community-server/src
# Informs Docker that the container listens on the specified network port at runtime
EXPOSE 3000
# Set command run by the container
ENTRYPOINT [ "npx", "community-solid-server", "-c", "/config/config-penny.json" ]
# By default run in filemode (overriden if passing alternative arguments or env vars)
ENV CSS_CONFIG=/config/config-penny.json
ENV CSS_ROOT_FILE_PATH=/dataThis can be built in the penny folder docker build -t mypennyexample:latest . and then be used to run with docker run --rm --name test -p 3000:3000 -v C:\Users\user\mydata:/data -it mypennyexample:latest.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The main https://github.com/CommunitySolidServer/CommunitySolidServer repo has instructions for running with Docker. To make integrating the recipes easier into existing Docker workflows, I've added a minimal Dockerfile for each of the extensions and instructions how to use them.
I've only recently started using Docker, so a review of the Dockerfiles by someone with more experience might be helpful