Skip to content

Commit

Permalink
change docker-compose profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
dcmcand committed Nov 24, 2023
1 parent 4069089 commit 9186db4
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 387 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/node_modules
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ jobs:
run: |
sudo apt install wait-for-it -y
playwright install chromium
yarn install
yarn build
yarn install --frozen-lockfile
yarn run build
- name: "Deploy webpack dev server"
shell: bash -el {0}
run: |
yarn start & pytest --video on --output test-results --screenshots true test/playwright/test_ux.py
yarn run start & pytest --video on --output test-results --screenshots true test/playwright/test_ux.py
- name: "Upload artifacts"
uses: actions/upload-artifact@v3
Expand Down
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,13 @@ src/version.ts

# playwright screenshots
static

# yarn

.yarn/*
!.yarn/releases
!.yarn/patches
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*#
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ FROM node:18.18-alpine3.18
WORKDIR /usr/src/app

COPY . .
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn \
yarn install --network-timeout 600000 && \
if [[ ! -f ".env" ]]; then mv .env.example .env; fi;

RUN yarn install --network-timeout 600000

RUN mv .env.example .env

EXPOSE 80
EXPOSE 8000

CMD [ "yarn", "webpack-dev-server", "--port", "80" ]
CMD [ "yarn", "webpack-dev-server", "--port", "8000" ]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ We use [Docker Compose](https://docs.docker.com/compose/) to set up the infrastr
### Local Development with conda-store-ui running in Docker
Running conda-store-ui in Docker is the simplest way to setup your local development environment.

1. Simply run `docker-compose up` to start the entire development stack.
1. Simply run `yarn run start:docker` to start the entire development stack.
2. Open you local browser and go to [http://localhost:8000](http://localhost:8000) so see conda-store-ui.
3. You can then login using the default username of `username` and default password of `password`.

Expand All @@ -53,7 +53,7 @@ This project uses [Conda](https://conda.io) for package management. To set up Co
3. Activate the development environment `conda activate cs-ui-dev-env`
4. Install yarn dependencies `yarn install`
#### run the application
1. run `yarn start` and wait for the application to finish starting up
1. run `yarn run start` and wait for the application to finish starting up
2. Open you local browser and go to [http://localhost:8000](http://localhost:8000) so see conda-store-ui.
3. You can then login using the default username of `username` and default password of `password`.

Expand Down
16 changes: 4 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ version: "3.8"

services:
conda-store-worker:
profiles:
- local-dev
image: quansight/conda-store-server:${CONDA_STORE_SERVER_VERSION:-2023.10.1}
volumes:
- ./docker/assets/environments:/opt/environments:ro
Expand All @@ -21,8 +19,6 @@ services:

conda-store-server:
image: quansight/conda-store-server:${CONDA_STORE_SERVER_VERSION:-2023.10.1}
profiles:
- local-dev
depends_on:
postgres:
condition: service_healthy
Expand All @@ -48,8 +44,6 @@ services:

minio:
image: minio/minio:RELEASE.2020-11-10T21-02-24Z
profiles:
- local-dev
ports:
- "9000:9000"
healthcheck:
Expand All @@ -65,8 +59,6 @@ services:

postgres:
image: postgres:13
profiles:
- local-dev
user: postgres
ports:
- 5432:5432
Expand All @@ -81,8 +73,6 @@ services:

redis:
image: bitnami/redis
profiles:
- local-dev
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
Expand All @@ -93,7 +83,9 @@ services:

conda-store-ui:
build: .
command: "yarn run start --port 8000 --history-api-fallback"
command: "yarn run start:ui --port 8000 --history-api-fallback"
profiles:
- local-dev
ports:
- "8000:8000"
depends_on:
Expand All @@ -104,7 +96,7 @@ services:
- .:/usr/src/app
healthcheck:
test:
["CMD", "curl", "--fail", "http://localhost"]
["CMD", "curl", "--fail", "http://localhost:8000"]
interval: 20s
timeout: 10s
retries: 8
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@
"build:watch": "tsc --build --watch",
"clean": "rimraf coverage lib storybook-static types .env *.tsbuildinfo",
"clean:slate": "yarn run clean && rimraf node_modules",
"clean:docker": "docker-compose down -v --remove-orphans",
"eslint": "eslint . --ext .ts,.tsx --fix",
"eslint:check": "eslint . --ext .ts,.tsx",
"prepare": "yarnpkg run build && husky install",
"prepublishOnly": "yarnpkg run clean && yarnpkg run webpack:prod",
"start": "docker-compose --profile local-dev up -d && webpack server --history-api-fallback",
"start:docker": "docker-compose --profile local-dev up --build",
"start": "yarn run start:services && yarn run start:ui",
"start:services": "docker-compose up -d",
"start:ui": "webpack server --history-api-fallback",
"start:chromium": "webpack serve --open 'chromium'",
"start:prod": "NODE_ENV=production webpack serve",
"storybook": "start-storybook -p 6006",
Expand Down Expand Up @@ -49,13 +53,11 @@
"dependencies": {
"@codemirror/language": "^6.2.1",
"@codemirror/legacy-modes": "^6.1.0",
"@codemirror/view": "^6.22.0",
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@lezer/highlight": "^1.1.2",
"@mui/icons-material": "^5.8.4",
"@mui/material": "^5.6.1",
"@mui/system": "^5.14.18",
"@reduxjs/toolkit": "^1.8.2",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
Expand All @@ -70,11 +72,9 @@
"match-sorter": "^6.3.1",
"react": "^18.0.0",
"react-beautiful-dnd": "^13.1.0",
"react-codemirror": "^1.0.0",
"react-dom": "^18.0.0",
"react-infinite-scroll-component": "^6.1.0",
"react-redux": "^8.0.2",
"react-router": "^6.20.0",
"react-router-dom": "^6.3.0",
"redux": "^4.2.0",
"semver": "^7.3.8",
Expand Down Expand Up @@ -103,7 +103,6 @@
"@types/jest": "^28.1.6",
"@types/lodash": "^4.14.182",
"@types/react-beautiful-dnd": "^13.1.2",
"@types/react-codemirror": "^1",
"@types/react-test-renderer": "^18.0.0",
"@types/semver": "^7.3.13",
"@types/tough-cookie": "^4.0.2",
Expand Down Expand Up @@ -133,7 +132,6 @@
"remark-gfm": "^3.0.1",
"rimraf": "^3.0.2",
"source-map-loader": "^3.0.1",
"terser-webpack-plugin": "^5.3.9",
"ts-loader": "^8.0.17",
"typescript": "^4.6.3",
"webpack": "^5.72.0",
Expand Down
4 changes: 2 additions & 2 deletions src/docs/markdown/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ We use [Docker Compose](https://docs.docker.com/compose/) to set up the infrastr
## Local Development with conda-store-ui running in Docker
Running conda-store-ui in Docker is the simplest way to setup your local development environment.

1. Simply run `docker-compose up` to start the entire development stack.
1. Simply run `yarn run start:docker` to start the entire development stack.
2. Open you local browser and go to [http://localhost:8000](http://localhost:8000) so see conda-store-ui.
3. You can then login using the default username of `username` and default password of `password`.

Expand All @@ -28,7 +28,7 @@ This project uses [Conda](https://conda.io) for package management. To set up Co
3. Activate the development environment `conda activate cs-ui-dev-env`
4. Install yarn dependencies `yarn install`
### run the application
1. run `yarn start` and wait for the application to finish starting up
1. run `yarn run start` and wait for the application to finish starting up
2. Open you local browser and go to [http://localhost:8000](http://localhost:8000) so see conda-store-ui.
3. You can then login using the default username of `username` and default password of `password`.

Expand Down
Loading

0 comments on commit 9186db4

Please sign in to comment.