mirror of
https://github.com/docker/awesome-compose.git
synced 2025-04-29 07:38:02 +02:00
Frontend+Backend fixes
Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
parent
718df2a62d
commit
996b7ac9bf
10 changed files with 128 additions and 42 deletions
|
@ -1,26 +1,34 @@
|
|||
FROM node:lts AS development
|
||||
# Create image based on the official Node image from dockerhub
|
||||
FROM node:lts-buster as build
|
||||
|
||||
WORKDIR /app
|
||||
# Create app directory
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# add `/app/node_modules/.bin` to $PATH
|
||||
ENV PATH /app/node_modules/.bin:$PATH
|
||||
# Copy dependency definitions
|
||||
COPY package.json /usr/src/app
|
||||
COPY package-lock.json /usr/src/app
|
||||
|
||||
# install app dependencies
|
||||
COPY package.json ./
|
||||
COPY package-lock.json ./
|
||||
# Install dependecies
|
||||
#RUN npm set progress=false \
|
||||
# && npm config set depth 0 \
|
||||
# && npm i install
|
||||
RUN npm ci
|
||||
|
||||
# add app
|
||||
COPY . ./
|
||||
# Get all the code needed to run the app
|
||||
COPY . /usr/src/app
|
||||
|
||||
# start app
|
||||
CMD ["npm", "start"]
|
||||
|
||||
ENV CI=true
|
||||
ENV PORT=3000
|
||||
|
||||
FROM development AS build
|
||||
# Expose the port the app runs in
|
||||
# EXPOSE 3000
|
||||
# FROM development AS build
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:1.13-alpine
|
||||
COPY --from=build /code/build /usr/share/nginx/html
|
||||
COPY --from=build /usr/src/app/build /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
#COPY --from=build-env "samples/dotnet-frontend/ngnix.conf" /etc/nginx/nginx.conf
|
||||
#FROM nginx:1.13-alpine
|
||||
# COPY --from=builder /usr/src/app/build /usr/share/nginx/html
|
||||
# COPY nginx/dev.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue