Skip to content

Commit

Permalink
Fixes for running docker locally
Browse files Browse the repository at this point in the history
  • Loading branch information
Agnieszka Figiel committed Oct 19, 2023
1 parent b94ba23 commit f632819
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
8 changes: 5 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 @@ -37,4 +39,4 @@ RUN yarn install
ENV PATH /app/node_modules/.bin:$PATH

EXPOSE 1337
ENTRYPOINT ["/app/cms/entrypoint.sh"]
ENTRYPOINT ["/app/entrypoint.sh"]
2 changes: 1 addition & 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 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 f632819

Please sign in to comment.