-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Package.json is not found in backend:test #2
Comments
I have the same error , how can we solve it? |
For now, to bypass this I've gone ahead and grabbed the From the root of this wget "https://raw.githubusercontent.com/medusajs/medusa/master/package.json" -O backend/package.json
sed -i 's,=error,=error --force,' backend/Dockerfile
docker-compose up --build
docker-compose up -d |
Hmmm, there are actually quite a few other issues. 😓 |
First of all, thanks for this amazing project!! Would be AWESOME if there would be a working docker-compose example <3 Also can we change the postgres port used by this stack by just adding command -p to postgres and changing the database url accordingly? Thanks in advance |
I'm trying to decide if it's worth it to try and figure this all out and get this running through docker compose or if I should cut my losses and ditch using docker or create my own docker compose file from scratch. Did you ever get it working using docker compose? What where the other issues? |
I talked with a maintainer on discord and they said that you're supposed to bootstrap a medusa project using |
That's not all. This repository is not ready for use because it lacks some documentation. When they throw in a Anyhow, this is what worked for me (still struggling with building the last missing piece, the storefront) - note: I used # api/Dockerfile
FROM node:17.0.0-alpine
WORKDIR /usr/src/app
RUN apk update && apk add git
RUN git config --global user.name medusa-user
RUN git config --global user.email [email protected]
RUN npm install -g @medusajs/medusa-cli
RUN test -f develop.sh || medusa new . --seed
# enable if you have a config file
# COPY api/medusa-config.js .
COPY api/entrypoint.sh .
ENTRYPOINT [ "sh", "entrypoint.sh" ] # api/entrypoint.sh
#!/usr/bin/env sh
# run migrations
medusa migrations run
# create admin login
medusa user -e "$ADMIN_LOGIN_EMAIL" -p "$ADMIN_LOGIN_PASSWORD"
# run api server
medusa develop # docker-compose.yml
version: '3'
services:
# medusa store api
api:
image: medusa-api
# volumes: # enable when you have a local config file
# - ./api/medusa-config.js:/usr/src/app/medusa-config.js
working_dir: /usr/src/app
ports:
- 9000:9000
depends_on:
- pg
- redis
restart: always
build:
context: .
dockerfile: api/Dockerfile
env_file: .env
environment:
STORE_CORS: ${API_STORE_CORS}
# database
pg:
image: postgres:11.2-alpine
restart: always
volumes:
- ./data/pg:/var/lib/postgresql/data
env_file: .env
# cache
redis:
image: redis:3.2-alpine
restart: always
command: ["redis-server", "--appendonly", "yes"]
volumes:
- ./data/redis:/data
volumes:
data: # .env
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=medusa
DATABASE_URL=postgres://postgres:postgres@pg:5432/medusa
REDIS_URL=redis://redis
NODE_ENV=dev
API_STORE_CORS=http://localhost
GATSBY_MEDUSA_BACKEND_URL=http://api:9000
GATSBY_STORE_URL=http://localhost:6000
[email protected]
ADMIN_LOGIN_PASSWORD=your-strong-admin-password
NODE_OPTIONS=--openssl-legacy-provider |
Package.json is not found in backend:test
The text was updated successfully, but these errors were encountered: