Skip to content

Instantly share code, notes, and snippets.

@sumitsahoo
Last active July 15, 2020 11:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sumitsahoo/fb54bbf68a80a8f669970e521d5175a4 to your computer and use it in GitHub Desktop.
Save sumitsahoo/fb54bbf68a80a8f669970e521d5175a4 to your computer and use it in GitHub Desktop.
Start strapi in dev configuration
# Use the official lightweight Node.js image.
# https://hub.docker.com/_/node
FROM node:14.5.0-slim
# Create and change to the app directory.
WORKDIR /usr/src/app
# Set PROD/DEV environment
ENV NODE_ENV=development
#ENV NODE_ENV=production
# Copy application dependency manifests to the container image.
# A wildcard is used to ensure both package.json AND package-lock.json are copied.
# Copying this separately prevents re-running npm install on every code change.
COPY package*.json ./
# Update packages
RUN apt-get update -y
# Install yarn
RUN apt-get install yarn -y
# GCC, G++, Python, Make needed if Node version > 12. When v12 in use you can comment out below dependencies
RUN apt-get install gcc -y
RUN apt-get install g++ -y
RUN apt-get install python3 -y
RUN apt-get install make -y
# Install production dependencies.
RUN yarn install --production=true
# Copy local code to the container image.
COPY . ./
# Build Strapi
RUN yarn build
#EXPOSE 1337
# Run the web service on container startup.
CMD [ "yarn", "develop" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment