diff --git a/.env.default b/.env.default index dbdcd7560..b78b5599a 100644 --- a/.env.default +++ b/.env.default @@ -11,6 +11,8 @@ DOCKER_COMPOSE_APP_DEV_PORT_TARGET=9001 # The env var DEFAULT_PAD_TEXT seems to be mandatory in the latest version of etherpad. DOCKER_COMPOSE_APP_DEV_ENV_DEFAULT_PAD_TEXT="Welcome to etherpad" +DOCKER_COMPOSE_APP_DEV_ADMIN_PASSWORD= + DOCKER_COMPOSE_POSTGRES_DEV_ENV_POSTGRES_DATABASE=db DOCKER_COMPOSE_POSTGRES_DEV_ENV_POSTGRES_PASSWORD=etherpad-lite-password DOCKER_COMPOSE_POSTGRES_DEV_ENV_POSTGRES_USER=etherpad-lite-user \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 33f00016e..0e37f3b64 100644 --- a/Dockerfile +++ b/Dockerfile @@ -87,7 +87,9 @@ FROM build as development COPY --chown=etherpad:etherpad ./src/package.json .npmrc ./src/pnpm-lock.yaml ./src/ COPY --chown=etherpad:etherpad ./src/bin ./src/bin -COPY --chown=etherpad:etherpad ${SETTINGS} "${EP_DIR}"/settings.json +COPY --chown=etherpad:etherpad ./var ./var +COPY --chown=etherpad:etherpad ./node_modules ./node_modules +COPY --chown=etherpad:etherpad ${SETTINGS} ./settings.json RUN { [ -z "${ETHERPAD_PLUGINS}" ] || \ pnpm install --no-save --legacy-peer-deps ${ETHERPAD_PLUGINS}; } && \ @@ -101,7 +103,10 @@ FROM build as production ENV NODE_ENV=production ENV ETHERPAD_PRODUCTION=true -COPY --chown=etherpad:etherpad ./ ./ +COPY --chown=etherpad:etherpad ./src ./src +COPY --chown=etherpad:etherpad ./var ./var +COPY --chown=etherpad:etherpad ./node_modules ./node_modules +COPY --chown=etherpad:etherpad ${SETTINGS} ./settings.json # Plugins must be installed before installing Etherpad's dependencies, otherwise # npm will try to hoist common dependencies by removing them from diff --git a/doc/docker.adoc b/doc/docker.adoc index 5b58335ba..ec5277f80 100644 --- a/doc/docker.adoc +++ b/doc/docker.adoc @@ -33,7 +33,7 @@ Starting dev server: docker compose exec app bash -c "./src/bin/run.sh" ``` -For production, please create your own docker compose file and change the `target` property in the build section to `production`, for instance: +For production, please create your own docker compose file and change the `target` property in the build section to `production`. In addition, change the NODE_ENV in environment to production. For instance: ``` docker compose -f docker-compose-production.yml up -d diff --git a/docker-compose.yml b/docker-compose.yml index d2c4b4794..4a7bd3196 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,12 +14,14 @@ services: tty: true stdin_open: true volumes: - - .:/opt/etherpad-lite + - ./src:/opt/etherpad-lite/src - node_modules:/opt/etherpad-lite/src/node_modules + - pnpm-store:/opt/etherpad-lite/src/.pnpm-store depends_on: - postgres environment: NODE_ENV: development + ADMIN_PASSWORD: ${DOCKER_COMPOSE_APP_DEV_ADMIN_PASSWORD} DB_CHARSET: ${DOCKER_COMPOSE_APP_DEV_ENV_DB_CHARSET:-utf8mb4} DB_HOST: postgres DB_NAME: ${DOCKER_COMPOSE_POSTGRES_DEV_ENV_POSTGRES_DATABASE:?} @@ -56,4 +58,5 @@ services: volumes: postgres_data: - node_modules: \ No newline at end of file + node_modules: + pnpm-store: \ No newline at end of file