further refactoring

This commit is contained in:
Jannik Streek 2024-02-16 11:03:40 +01:00
parent d3573d1f54
commit 3ef07e5d91
4 changed files with 15 additions and 5 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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:
node_modules:
pnpm-store: