Skip to content

Loading Payload in a Docker Container #353

Answered by denolfe
joecaraccio asked this question in Q&A
Discussion options

You must be logged in to vote

The latest version of create-payload-app will create a docker-compose file that is ready to use for development 🎉

Here is what it looks like if you're wanting to adapt it to an existing project:

version: '3'

services:

  payload:
    image: node:18-alpine
    ports:
      - "3000:3000"
    volumes:
      - .:/home/node/app
      - node_modules:/home/node/app/node_modules
    working_dir: /home/node/app/
    command: sh -c "yarn install && yarn dev"
    depends_on:
      - mongo
    environment:
      MONGODB_URI: mongodb://mongo:27017/payload
      PORT: 3000
      NODE_ENV: development
      PAYLOAD_SECRET: TESTING

  mongo:
    image: mongo:latest
    ports:
      - "27017:27017"
    c…

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@joecaraccio
Comment options

Comment options

You must be logged in to vote
6 replies
@joecaraccio
Comment options

@joecaraccio
Comment options

@jmikrut
Comment options

@donstephan
Comment options

@alexbechmann
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by denolfe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants