Skip to content

Commit

Permalink
feat: Dockerize the Svelte web app
Browse files Browse the repository at this point in the history
  • Loading branch information
iczc committed May 28, 2021
1 parent 3f53db5 commit 9f956fb
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
# eth-faucet
# eth-faucet

## Quick Start
```bash
$ docker compose up -d
```
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ services:
restart: always

web:
image: nginx:alpine
build: web
container_name: faucet-web
ports:
- "80:80"
links:
- api
volumes:
- "./web/public:/usr/share/nginx/html"
- "./nginx:/etc/nginx/conf.d"
restart: always
1 change: 1 addition & 0 deletions web/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/node_modules/
/public/build/

.vercel
.DS_Store
16 changes: 16 additions & 0 deletions web/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:lts-alpine as build-stage

WORKDIR /app

COPY rollup.config.js ./
COPY package*.json ./
RUN npm install

COPY ./src ./src
COPY ./public ./public
RUN npm run build

FROM nginx:stable-alpine as production-stage
COPY --from=build-stage /app/public /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

0 comments on commit 9f956fb

Please sign in to comment.