Skip to content

Commit

Permalink
Merge pull request #10 from Vizzuality/improvement/backport_from_scaf…
Browse files Browse the repository at this point in the history
…fold

Improvement/backport from scaffold
  • Loading branch information
agnessa authored Oct 19, 2023
2 parents 97e1a16 + f632819 commit d3dc3e9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
10 changes: 7 additions & 3 deletions cms/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM node:18.17-bullseye-slim
# Install dependencies

RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get install -y \
Expand All @@ -11,10 +11,12 @@ RUN apt-get update -y && \
libpng-dev \
nasm bash \
libvips-dev \
git \
&& apt-get clean

ENV NODE_ENV development

WORKDIR /app/
WORKDIR /app

COPY .yarn ./.yarn
COPY config ./config
Expand All @@ -24,15 +26,17 @@ COPY src ./src

COPY .env \
.nvmrc \
.yarnrc.yml \
favicon.png \
package.json \
entrypoint.sh \
tsconfig.json \
yarn.lock \
./

RUN yarn install

ENV PATH /app/node_modules/.bin:$PATH

EXPOSE 1337
ENTRYPOINT ["/app/cms/entrypoint.sh"]
ENTRYPOINT ["/app/entrypoint.sh"]
4 changes: 3 additions & 1 deletion cms/Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build all the things
FROM node:18.17-bullseye-slim as build

RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get install -y \
Expand All @@ -25,10 +25,12 @@ COPY src ./src

COPY .env \
.nvmrc \
.yarnrc.yml \
favicon.png \
package.json \
entrypoint.sh \
tsconfig.json \
yarn.lock \
./

RUN yarn install
Expand Down
8 changes: 8 additions & 0 deletions cms/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: "3.9" # optional since v1.27.0
services:
cms:
build: .
ports:
- "1337:1337"
extra_hosts:
- "host.docker.internal:host-gateway"
2 changes: 2 additions & 0 deletions cms/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ case "${NODE_ENV}" in
exec yarn test
;;
production)
echo "Import config"
yarn config-sync import -y
echo "Running Production Server"
exec yarn start
;;
Expand Down

0 comments on commit d3dc3e9

Please sign in to comment.