Move standalone.Dockerfile to contrib directory

This commit is contained in:
Alisina Bahadori
2020-09-20 17:34:27 +04:30
parent 1564f56a87
commit 0cfe7461dd
2 changed files with 49 additions and 0 deletions
@@ -0,0 +1,28 @@
FROM node:12 AS build
# This dockerfile does not require the app to be built on the host machine.
# simply builds backstage in node image then transfers compiled files to nginx container.
# You can build this image with `docker build -f Dockerfile.standalone -t backstage .`
RUN mkdir /app
COPY . /app
WORKDIR /app
RUN yarn install
RUN yarn workspace example-app build
# Contruct backstage image
FROM nginx:mainline
RUN apt-get update && apt-get -y install jq && rm -rf /var/lib/apt/lists/*
# Copy from build stage
COPY --from=build /app/packages/app/dist /usr/share/nginx/html
COPY docker/default.conf.template /etc/nginx/conf.d/default.conf.template
COPY docker/run.sh /usr/local/bin/run.sh
CMD run.sh
ENV PORT 80
@@ -0,0 +1,21 @@
# Standalone Dockerfile for frontend
This directory contains the resources which will help you build backstage without any requirements
other than docker itself. It uses a multi-stage Dockerfile to build and ship backstage.
## Usage
You can simply run the following command to build backstage.
```
# Make sure you are in the root directory of backstage then run
docker build -t backstage -f ./contrib/docker/multi-stage-frontend/Dockerfile .
```
After a successful build, You can simply run backstage frontend with the following command.
```
docker run -it --rm -p 3080:80 backstage
```