diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +node_modules/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..545e563 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM node:current-alpine3.19 + +RUN mkdir -p /app +WORKDIR /app + +COPY package.json ./package.json +COPY package-lock.json ./package-lock.json + +RUN apk add --update python3 make g++\ +&& rm -rf /var/cache/apk/* +RUN apk add --no-cache bash + +RUN yarn add dotenv +RUN yarn -python=python3 + +COPY . /app + +CMD ["yarn", "run", "start"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..20fec40 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +services: + api: + build: + context: . + dockerfile: ./Dockerfile + command: ["yarn", "run", "start"] + ports: + - "3001:3001" + volumes: + - .:/AlgorithmWikiAPI + env_file: + - .env