Skip to content

#1635 FEAT: Set Docker image building process #1708

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
.nuxt
node_modules
npm-debug.log
Dockerfile*
docker-compose*
.dockerignore
.git
.gitignore
README.md
LICENSE
.nuxt
.vscode
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Dockerfile
FROM node:lts

WORKDIR /kodadot-app
WORKDIR /app

EXPOSE 9090

COPY package.json /kodadot-app/package.json
COPY package.json .
COPY yarn.lock .

RUN yarn install
RUN yarn build

ENV NUXT_HOST=0.0.0.0
ENV NUXT_PORT=9090
COPY . .

ENV HOST 0.0.0.0
EXPOSE 9090

CMD [ "yarn", "dev" ]
48 changes: 23 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Thank to [contributors-img](https://contrib.rocks).

We are using `yarn` workspace, as installing things via npm **will result in broken dependencies.**

## Play-🕹
## Play-🕹

```shell
git clone [email protected]:kodadot/nft-gallery.git
Expand All @@ -105,7 +105,7 @@ yarn dev
open http://localhost:9090/
```

## I want to contribute- 🙋‍
## I want to contribute- 🙋‍

Sure, your **contribution** is more than welcome. Please follow [code of conduct](CODE_OF_CONDUCT.md) and **[contribution guidelines](CONTRIBUTING.md)**

Expand All @@ -126,36 +126,34 @@ We have list of frequent participants in our codebase.
- Want to be on this list? Become frequent participant by contributing more, [come with us](https://open.spotify.com/track/5kTBiVnjq9xKmZL9dNs8zL?si=9fc60b8b87764969)!
- [You can learn about our Contributors base](https://github.com/kodadot/nft-gallery/graphs/contributors)

## Docker-🐳
## Docker-🐳
If you just want to try out our KodaDot on Kusama and have a full local setup with a local node, we assume you have [docker](https://docs.docker.com/get-docker/) and docker-compose installed.

Run Kodadot locally
```bash
docker-compose up -d --build
```
- ### First time setup

Build docker image of KodaDot
```bash
docker build . -t kodadot-app
```
- Build the docker image

Check if container is up
```bash
docker ps
```
```bash
# Make sure you are logged into docker.

Run it locally and then visit `localhost:9090`
```bash
docker run -p 9090:9090 --name kodadot kodadot-app
```
docker-compose up --build
```

Someone clean it pls, bounty for devops https://github.com/kodadot/nft-gallery/issues/1635
```
docker build -t nuxtapp .
docker run -it -p 0.0.0.0:9090:9090 nuxtapp
```
then go to the http://0.0.0.0:9090
- To check if container is up:
```bash
docker ps
```

- ### From next time

Simply run:

```bash
docker-compose up
```

Voila! KodaDot will be available at [localhost:9090](http://localhost:9090).
KodaDot supports Hot Module Replacement on docker as well, any changes made will take effect immediately.

## Dev hints

Expand Down
11 changes: 5 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3.7'
version: "3.8"

services:
frontend:
Expand All @@ -7,9 +7,8 @@ services:
context: .
dockerfile: Dockerfile
volumes:
- '.:/kodadot-app'
- '/kodadot-app/node_modules'
- ./:/app
command: yarn dev
ports:
- '0.0.0.0:9090:9090'
environment:
- CHOKIDAR_USEPOLLING=true
- "9090:9090"
env_file: .env
3 changes: 2 additions & 1 deletion nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ export default {

watchers: {
webpack: {
poll: true
aggregateTimeout: 300,
poll: 1000,
}
},
// env: {
Expand Down