-
-
Save Frioo/2a33a112b39906cc783a9de88525acb2 to your computer and use it in GitHub Desktop.
Medusa docker setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Medusa | |
DATABASE_TYPE=postgres | |
DATABASE_URL=postgres://medusa:secret@db/medusa | |
DATABASE=medusa | |
REDIS_URL=redis://cache | |
STORE_CORS=http://localhost:3000 | |
JWT_SECRET=secret | |
COOKIE_SECRET=secret | |
# Postgres | |
POSTGRES_USER=medusa | |
POSTGRES_PASSWORD=secret | |
POSTGRES_DB=medusa | |
# Storefront | |
PUBLIC_MEDUSA_URL=http://medusa:9000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.8' | |
services: | |
medusa: | |
build: | |
context: ./medusa-backend | |
dockerfile: Dockerfile | |
container_name: medusa | |
restart: unless-stopped | |
ports: | |
- 9000:9000 | |
env_file: | |
- .env | |
depends_on: | |
- db | |
- cache | |
db: | |
image: postgres | |
env_file: | |
- .env | |
volumes: | |
- pgdata:/var/lib/postgresql/data | |
restart: unless-stopped | |
cache: | |
image: redis:7.2.4 | |
container_name: cache | |
volumes: | |
pgdata: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.8' | |
services: | |
medusa: | |
build: | |
context: ./medusa-backend | |
dockerfile: Dockerfile | |
container_name: medusa | |
restart: unless-stopped | |
depends_on: | |
- db | |
- cache | |
db: | |
image: postgres | |
volumes: | |
- pgdata:/var/lib/postgresql/data | |
restart: unless-stopped | |
cache: | |
image: redis:7.2.4 | |
container_name: cache | |
storefront: | |
build: | |
context: ./3station-storefront | |
dockerfile: Dockerfile | |
container_name: storefront | |
depends_on: | |
- medusa | |
volumes: | |
pgdata: | |
external: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run the migrations | |
npx medusa migrations run | |
# Start server | |
yarn start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:lts | |
WORKDIR /app | |
COPY package.json . | |
COPY yarn.lock . | |
RUN yarn | |
COPY . . | |
RUN yarn global add @medusajs/medusa-cli | |
RUN yarn build | |
COPY docker-entrypoint.sh / | |
RUN chmod +x /docker-entrypoint.sh | |
ENTRYPOINT ["/bin/sh", "/docker-entrypoint.sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment