Skip to content

Instantly share code, notes, and snippets.

@sotnikov-link
Last active March 21, 2023 02:29
Show Gist options
  • Save sotnikov-link/5023fac06c687d416f003b09e2634c82 to your computer and use it in GitHub Desktop.
Save sotnikov-link/5023fac06c687d416f003b09e2634c82 to your computer and use it in GitHub Desktop.
How to use Docker with Node.js and full-icu?

How to use Docker with Node.js and full-icu?

Solution

Example for Dockerfile

FROM node:lts-alpine

WORKDIR /icu
RUN npm init -y && npm install full-icu
ENV NODE_ICU_DATA=/icu/node_modules/full-icu

WORKDIR /project
COPY package*.json ./
RUN npm install
COPY . .

EXPOSE 8080
CMD [ "node", "server.js" ]

Check for full-icu

The command should return the Russian name of the current month

node --icu-data-dir=/icu/node_modules/full-icu -e "console.dir(new Date().toLocaleString('ru',{month:'long'}));"

Related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment