Skip to content

Commit

Permalink
feat(KUI-1542): add Dockerfile-dev and update docker-compose.yml.in
Browse files Browse the repository at this point in the history
  • Loading branch information
amirhossein-haerian committed Nov 22, 2024
1 parent cbc59e9 commit e162c90
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ dist

# Docker
*.env*
Dockerfile-dev

# KTH Node Web Common imported files
server/views/system/error.handlebars
Expand Down
39 changes: 39 additions & 0 deletions Dockerfile-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM kthregistry.azurecr.io/kth-nodejs-20:latest
LABEL maintainer="KTH-studadm studadm.developers@kth.se"

WORKDIR /application
ENV NODE_PATH /application

ENV TZ Europe/Stockholm

COPY ["config", "config"]
COPY ["i18n", "i18n"]
COPY ["public", "public"]
COPY ["server", "server"]
COPY ["domain", "domain"]

COPY [".babelrc", ".babelrc"]
COPY ["app.js", "app.js"]
COPY ["build.sh", "build.sh"]
COPY ["package.json", "package.json"]
COPY ["package-lock.json", "package-lock.json"]
COPY ["webpack.config.js", "webpack.config.js"]
# Config for jest tester
COPY ["babel.config.js", "babel.config.js"]
COPY ["jest.config.js", "jest.config.js"]

RUN chmod a+rx build.sh && \
chown -R node:node /application

USER node

RUN npm pkg delete scripts.prepare && \
npm ci --unsafe-perm && \
npm run build && \
npm prune --production

EXPOSE 3000

ENV TZ Europe/Stockholm

CMD ["npm", "run", "docker:start"]
6 changes: 4 additions & 2 deletions docker-compose.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ services:
# Existing image in repository
# image: kthse/docker pull kthse/kth-nodejs-web:13.37

# Build from Dockerfile in current directory
build: .
# Build from Dockerfile-dev in current directory
build:
context: .
dockerfile: Dockerfile-dev # if it does not exist you can generate it by runing the docker-build-image.sh script

environment:
# Cellus Deployment
Expand Down

0 comments on commit e162c90

Please sign in to comment.