Merge pull request #6211 from overleaf/em-code-sharing

Change directory layout in service containers

GitOrigin-RevId: 09ff19db2a123cbf7691d51e9ce9be6eee264287
This commit is contained in:
Eric Mc Sween
2022-01-07 09:03:22 +00:00
committed by Copybot
parent 6ddbf23da0
commit f3f0be5c56
57 changed files with 225 additions and 210 deletions
+5 -8
View File
@@ -4,22 +4,19 @@
FROM node:14.18.1 as base
WORKDIR /app
COPY install_deps.sh /app
WORKDIR /overleaf/services/filestore
COPY services/filestore/install_deps.sh /overleaf/services/filestore/
RUN chmod 0755 ./install_deps.sh && ./install_deps.sh
FROM base as app
#wildcard as some files may not be in all repos
COPY package*.json npm-shrink*.json /app/
COPY services/filestore/package*.json /overleaf/services/filestore/
RUN npm ci --quiet
COPY . /app
COPY services/filestore /overleaf/services/filestore
FROM base
COPY --from=app /app /app
FROM app
RUN mkdir -p uploads user_files template_files \
&& chown node:node uploads user_files template_files
USER node
+3 -2
View File
@@ -94,12 +94,13 @@ build:
--cache-from gcr.io/overleaf-ops/$(PROJECT_NAME):main-deps \
--target base \
--file Dockerfile \
.
../..
docker build --pull --tag ci/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) \
--tag gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) \
--cache-from gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-deps \
.
--file Dockerfile \
../..
tar:
$(DOCKER_COMPOSE) up tar
+1 -1
View File
@@ -6,4 +6,4 @@ filestore
--env-pass-through=
--node-version=14.18.1
--public-repo=True
--script-version=3.13.0
--script-version=4.0.0
+8 -6
View File
@@ -7,11 +7,12 @@ version: "2.3"
services:
test_unit:
build:
context: .
context: ../..
dockerfile: services/filestore/Dockerfile
target: base
volumes:
- .:/app
working_dir: /app
- .:/overleaf/services/filestore
working_dir: /overleaf/services/filestore
environment:
MOCHA_GREP: ${MOCHA_GREP}
NODE_ENV: test
@@ -21,11 +22,12 @@ services:
test_acceptance:
build:
context: .
context: ../..
dockerfile: services/filestore/Dockerfile
target: base
volumes:
- .:/app
working_dir: /app
- .:/overleaf/services/filestore
working_dir: /overleaf/services/filestore
environment:
ELASTIC_SEARCH_DSN: es:9200
REDIS_HOST: redis