Added Dockerfile

main
duc1607 2 years ago
parent d805cefeae
commit e5664e7e0d

@ -2,4 +2,9 @@ JWT_SECRET=something
COOKIE_SECRET=something
DATABASE_TYPE="postgres"
REDIS_URL=redis://localhost:6379
REDIS_URL=redis://redis:6379
DATABASE_URL=postgres://postgres:123456@localhost/medusa-TBcY
MEDUSA_ADMIN_ONBOARDING_TYPE=nextjs
STORE_CORS=http://localhost:8000,http://localhost:7001
MEDUSA_ADMIN_ONBOARDING_NEXTJS_DIRECTORY=my-medusa-store-storefront

@ -0,0 +1,15 @@
FROM node:20-alpine
RUN apk add curl
WORKDIR /app
COPY package.json .
RUN npm install
COPY . .
RUN npm run build
CMD [ "npm", "run", "dev" ]

@ -0,0 +1,33 @@
version: '3.8'
services:
backend:
build:
context: .
dockerfile: ./Dockerfile
environment:
- MEDUSA_ADMIN_ONBOARDING_NEXTJS_DIRECTORY=/medusa-frontend
volumes:
- ./medusa-frontend:/medusa-frontend
restart: always
ports:
- 9000:9000
depends_on:
- postgres
- redis
postgres:
image: postgres:14
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: "123456"
POSTGRES_DB: medusa-TBcY
volumes:
- ./postgres-data:/var/lib/postgresql/data
redis:
image: redis:latest
restart: always
volumes:
- ./redis-data:/data

@ -55,7 +55,7 @@ const plugins = [
];
const modules = {
/*eventBus: {
eventBus: {
resolve: "@medusajs/event-bus-redis",
options: {
redisUrl: REDIS_URL
@ -66,7 +66,7 @@ const modules = {
options: {
redisUrl: REDIS_URL
}
},*/
},
};
/** @type {import('@medusajs/medusa').ConfigModule["projectConfig"]} */
@ -77,7 +77,7 @@ const projectConfig = {
database_url: DATABASE_URL,
admin_cors: ADMIN_CORS,
// Uncomment the following lines to enable REDIS
// redis_url: REDIS_URL
redis_url: REDIS_URL
};
/** @type {import('@medusajs/medusa').ConfigModule} */

Loading…
Cancel
Save