www/Dockerfile

27 lines
733 B
Docker

FROM node:18
ARG SITE_PORT=8080
ARG API_PORT=8081
EXPOSE ${SITE_PORT}
EXPOSE ${API_PORT}
# Create app directory
WORKDIR /app
# Install stripe-cli
RUN apt-get update && apt-get install -y curl gpg
RUN curl -s https://packages.stripe.dev/api/security/keypair/stripe-cli-gpg/public | gpg --dearmor >/usr/share/keyrings/stripe.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/stripe.gpg] https://packages.stripe.dev/stripe-cli-debian-local stable main" >>/etc/apt/sources.list.d/stripe.list \
&& apt-get update && apt-get install -y stripe
# Install app dependencies
COPY package*.json ./
ENV NODE_ENV production
RUN npm install
COPY .eleventyignore ./
COPY *.js ./
COPY .env ./
COPY . .
# Run api
ENTRYPOINT ["npm", "run", "--"]