Coder Social home page Coder Social logo

Comments (2)

ilyinon avatar ilyinon commented on May 9, 2024 1

@Elu43 thank you a lot!
It works.

I've added updated server.js to the dockerfile, steps with copying server.js and running "strapi build" to entrypoint.sh and after these steps it works like a charm!

Dockerfile

..
COPY docker-entrypoint.sh /usr/local/bin/
COPY server.js /srv/server.js
..

docker-entrypoint.sh

..
     $EXTRA_ARGS
    cp -f /srv/server.js /srv/app/config/server.js
    strapi build

  elif [ ! -d "node_modules" ] || [ ! "$(ls -qAL node_modules 2>/dev/null)" ]; then
..

from docker-strapi.

Elu43 avatar Elu43 commented on May 9, 2024

Hi, I had similar problem (it was trying to reach localhost). I removed all env variables from my docker compose, I manually edited ./config/server.js to add :

module.exports = ({ env }) => ({
host: env('HOST', '0.0.0.0'),
port: env.int('PORT', 1337),
url: env('PUBLIC_URL', 'https://youraddresshere'),

Then you have to docker exec inside the container, run "strapi build", restart the container.

from docker-strapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.