Skip to content
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

Create a docker-compose #6

Open
MaxLeiter opened this issue Mar 8, 2022 · 3 comments
Open

Create a docker-compose #6

MaxLeiter opened this issue Mar 8, 2022 · 3 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@MaxLeiter
Copy link
Owner

Server and client both have their respective Dockerfiles, which seem to work, but they can't communicate with one another.

@MaxLeiter MaxLeiter added this to the 1.0 milestone Mar 8, 2022
@MaxLeiter MaxLeiter added help wanted Extra attention is needed good first issue Good for newcomers labels Mar 8, 2022
@reeseovine
Copy link
Contributor

I made a rudimentary compose file...

version: '3.8'

services:
  server:
    build: ./server
    restart: unless-stopped
    user: 1000:1000
    environment:
      - "PORT=3000"
      - "JWT_SECRET=change_me!"

  client:
    build: ./client
    restart: unless-stopped
    user: 1000:1000
    depends_on:
      - server
    environment:
      - "API_URL=http://server:3000"
    ports:
      - "3748:3001"

...but they still can't talk to each other. From what I can tell, this is because API_URL=http://localhost:3000 in env.local gets baked in on build so setting it as a runtime env variable has no effect.

I just came across this article which may help?

I would try my hand at fixing this particular issue but I'm not familiar with NextJS so it'd probably take me a while 😅

@MaxLeiter
Copy link
Owner Author

Thanks! I have a few ideas for improving the environment variables right now. Would you mind opening a PR with the docker-compose and I can add my changes that way?

@reeseovine
Copy link
Contributor

Done! #13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

2 participants