Skip to content

Instantly share code, notes, and snippets.

@avishwakarma
Created October 18, 2018 16:42
Show Gist options
  • Save avishwakarma/4fe5f1b4df433be22932c1de1aa2647d to your computer and use it in GitHub Desktop.
Save avishwakarma/4fe5f1b4df433be22932c1de1aa2647d to your computer and use it in GitHub Desktop.
# Install node v10
FROM node:10
# Set the workdir /var/www/myapp
WORKDIR /var/www/myapp
# Copy the package.json to workdir
COPY package.json ./
# Run npm install - install the npm dependencies
RUN npm install
# Copy application source
COPY . .
# Copy .env.docker to workdir/.env - use the docker env
COPY .env.docker ./.env
# Expose application ports - (4300 - for API and 4301 - for front end)
EXPOSE 4300 4301
# Generate build
RUN npm run build
# Start the application
CMD ["npm", "run", "run:prod"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment