Skip to content

Commit

Permalink
Added support for hosting website via nginx docker (#153)
Browse files Browse the repository at this point in the history
* changed warning on local docker build to be Apple Silicon specific

* Copying host's dist/web to container's dist/web instead of dist/

---------

Co-authored-by: Emma <MarmadileManteater@proton.me>
  • Loading branch information
OwenTruong and MarmadileManteater committed Oct 11, 2023
1 parent 6a444dd commit cc2e8f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ WORKDIR /app
COPY package.json ./package.json
COPY yarn.lock ./yarn.lock
# copy `dist` if it exists already
COPY dis[t]/web ./dist/
COPY node_module[s] ./node_modules
COPY dis[t]/web ./dist/web
# git is needed for jinter
RUN apk add git
# don't rebuild if you don't have to
RUN if [ ! -d 'node_modules' ]; then yarn ci; fi
RUN if [ ! -d 'dist/web' ]; then yarn ci; fi

## Build Stage ##
FROM node:18-alpine AS build
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ yarn pack:web

### Commands for the PWA Docker Image
```bash

# 💨 Creates and runs the image locally. Add `--platform=linux/arm64` to docker build for ARM64 devices including Apple Silicon
docker build -t freetubecordova . # Warning, might take 10 minutes.
docker build -t freetubecordova . # Warning, might take a while on Apple Silicon
docker run --name ftcordova -d -p 8080:80 freetubecordova

# 🏃 Runs the image from Docker Hub.
Expand Down

0 comments on commit cc2e8f5

Please sign in to comment.