refact: removed s3 and added docker compose local storage env config
This commit is contained in:
		
							parent
							
								
									f5181cbe6e
								
							
						
					
					
						commit
						30b66fc7fe
					
				@ -4,10 +4,7 @@ PAYLOAD_SECRET=YOUR_SECRET_HERE
 | 
				
			|||||||
DOMAIN_NAME=localhost:3000
 | 
					DOMAIN_NAME=localhost:3000
 | 
				
			||||||
PORT=3000
 | 
					PORT=3000
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ACCESS_KEY_ID=
 | 
					MEDIA_VOLUME_PATH=
 | 
				
			||||||
SECRET_ACCESS_KEY=
 | 
					 | 
				
			||||||
BUCKET_NAME=
 | 
					 | 
				
			||||||
S3_ENDPOINT=
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
DEFAULT_EMAIL=
 | 
					DEFAULT_EMAIL=
 | 
				
			||||||
SMTP_HOST=
 | 
					SMTP_HOST=
 | 
				
			||||||
 | 
				
			|||||||
@ -1,16 +1,22 @@
 | 
				
			|||||||
 | 
					volumes:
 | 
				
			||||||
 | 
					  media:
 | 
				
			||||||
 | 
					    driver_opts:
 | 
				
			||||||
 | 
					      o: bind
 | 
				
			||||||
 | 
					      type: bind
 | 
				
			||||||
 | 
					      device: '${MEDIA_VOLUME_PATH}'
 | 
				
			||||||
 | 
					  node_modules:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
services:
 | 
					services:
 | 
				
			||||||
  payload:
 | 
					  payload:
 | 
				
			||||||
    container_name: "midrashim"
 | 
					    container_name: "ysandler-work"
 | 
				
			||||||
    image: node:18-alpine
 | 
					    image: node:18-alpine
 | 
				
			||||||
    ports:
 | 
					    ports:
 | 
				
			||||||
      - '${PORT}:${PORT}'
 | 
					      - '${PORT}:${PORT}'
 | 
				
			||||||
    volumes:
 | 
					    volumes:
 | 
				
			||||||
      - .:/home/node/app
 | 
					      - .:/home/node/app
 | 
				
			||||||
      - node_modules:/home/node/app/node_modules
 | 
					      - node_modules:/home/node/app/node_modules
 | 
				
			||||||
 | 
					      - media:/home/node/app/media
 | 
				
			||||||
    working_dir: /home/node/app/
 | 
					    working_dir: /home/node/app/
 | 
				
			||||||
    command: sh -c "npm install && npm run build && npm start"
 | 
					    command: sh -c "npm install && npm run build && npm start"
 | 
				
			||||||
    env_file:
 | 
					    env_file:
 | 
				
			||||||
      - .env
 | 
					      - .env
 | 
				
			||||||
volumes:
 | 
					 | 
				
			||||||
  data:
 | 
					 | 
				
			||||||
  node_modules:
 | 
					 | 
				
			||||||
 | 
				
			|||||||
@ -2,7 +2,6 @@ import { s3Storage } from '@payloadcms/storage-s3'
 | 
				
			|||||||
import { nodemailerAdapter } from '@payloadcms/email-nodemailer'
 | 
					import { nodemailerAdapter } from '@payloadcms/email-nodemailer'
 | 
				
			||||||
import { formBuilderPlugin } from '@payloadcms/plugin-form-builder'
 | 
					import { formBuilderPlugin } from '@payloadcms/plugin-form-builder'
 | 
				
			||||||
import { postgresAdapter } from '@payloadcms/db-postgres'
 | 
					import { postgresAdapter } from '@payloadcms/db-postgres'
 | 
				
			||||||
import { payloadCloudPlugin } from '@payloadcms/payload-cloud'
 | 
					 | 
				
			||||||
import path from 'path'
 | 
					import path from 'path'
 | 
				
			||||||
import { buildConfig } from 'payload'
 | 
					import { buildConfig } from 'payload'
 | 
				
			||||||
import { fileURLToPath } from 'url'
 | 
					import { fileURLToPath } from 'url'
 | 
				
			||||||
@ -64,22 +63,6 @@ export default buildConfig({
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  sharp,
 | 
					  sharp,
 | 
				
			||||||
  plugins: [
 | 
					  plugins: [
 | 
				
			||||||
    payloadCloudPlugin(),
 | 
					 | 
				
			||||||
    s3Storage({
 | 
					 | 
				
			||||||
      collections: {
 | 
					 | 
				
			||||||
        media: true,
 | 
					 | 
				
			||||||
      },
 | 
					 | 
				
			||||||
      bucket: process.env.BUCKET_NAME || '',
 | 
					 | 
				
			||||||
      config: {
 | 
					 | 
				
			||||||
        credentials: {
 | 
					 | 
				
			||||||
          accessKeyId: process.env.ACCESS_KEY_ID || '',
 | 
					 | 
				
			||||||
          secretAccessKey: process.env.SECRET_ACCESS_KEY || '',
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        region: 'us-east-1',
 | 
					 | 
				
			||||||
        endpoint: process.env.S3_ENDPOINT,
 | 
					 | 
				
			||||||
        forcePathStyle: true,
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    }),
 | 
					 | 
				
			||||||
    formBuilderPlugin({
 | 
					    formBuilderPlugin({
 | 
				
			||||||
      fields: {
 | 
					      fields: {
 | 
				
			||||||
        text: true,
 | 
					        text: true,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user