Created
October 18, 2018 16:42
-
-
Save avishwakarma/4fe5f1b4df433be22932c1de1aa2647d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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